DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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




Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links