User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 426,475 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,237 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 8653 | Replies: 2 | Solved
Reply
Join Date: Oct 2006
Location: England
Posts: 153
Reputation: ptaylor965 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Two Decimal Places

  #1  
Jul 28th, 2007
Hi,
Could you please show me how to get
1.9
to show with two decimal places (1.90)


you can use
Math.Round(1.99999999, 2)
if you want to bring the decimal places down to two
but how do you increase from zero or one decimal place up to two?


Thanks
Peter
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2006
Posts: 712
Reputation: QVeen72 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 97
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Master Poster

Re: Two Decimal Places

  #2  
Jul 29th, 2007
Hi,

Check this :

TextBox1.Text = Format(1.9, "0.00")
 
TextBox2.Text = Format(22, "0.00")
 

Regards
Veena
Reply With Quote  
Join Date: Oct 2006
Location: England
Posts: 153
Reputation: ptaylor965 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Re: Two Decimal Places

  #3  
Jul 29th, 2007
Thanks QVeen72,
It work perfectly.

I've only ever used Format with Dates beform and it never occured to used it with numerics


Thanks
Peter
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 4:00 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC