Currency Help...decimal etc...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Currency Help...decimal etc...

Hybrid View

  1. #1
    Wayne Guest

    Currency Help...decimal etc...


    Help, please! I am stuck on a problem. I am trying to multiply to textboxes
    and put the result in a currency format...I understand in VB.net there is
    not a currency format. Yet, when my qtytextbox * pricetextbox...in my total
    textbox I do not get any zeros.
    IE...30(qtytextbox) * 12.95(pricetextbox) my total is 388.5
    How do I make it read 388.50?

    Can ya please help?

    q = QtyTextBox.Text
    p = PriceTextBox.Text
    TotalTextBox.Text = q * p
    That is what I have...Please help!

    Peace,
    Wayne

  2. #2
    Michael Gautier Guest

    Re: Currency Help...decimal etc...

    Use the ToString method and pass in a format string as the parameter:

    __Total = QtyTextBox * PriceTextBox

    __Total.ToString(__Format);

    I don't have the format off hand, but that is a way of doing it.


    "Wayne" <Wburrini@yahoo.com> wrote in message
    news:3dc1e634$1@tnews.web.devx.com...
    >
    > Help, please! I am stuck on a problem. I am trying to multiply to

    textboxes
    > and put the result in a currency format...I understand in VB.net there is
    > not a currency format. Yet, when my qtytextbox * pricetextbox...in my

    total
    > textbox I do not get any zeros.
    > IE...30(qtytextbox) * 12.95(pricetextbox) my total is 388.5
    > How do I make it read 388.50?
    >
    > Can ya please help?
    >
    > q = QtyTextBox.Text
    > p = PriceTextBox.Text
    > TotalTextBox.Text = q * p
    > That is what I have...Please help!
    >
    > Peace,
    > Wayne




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center