About
Pricing
Community
Teams
Start Free Trial
Log in
Jason
asked on
3/17/2016
Formant number
I am looking to format a number to a particular format
example
number 59
I am looking to format it to 00059.0
any help would be great
Visual Basic.NET
5
1
Last Comment
Jason
8/22/2022 - Mon
SStory
3/17/2016
value=59
msgbox(value.ToString("###
#0.0", CultureInfo.InvariantCultu
re))
ASKER CERTIFIED SOLUTION
Éric Moreau
3/17/2016
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Rgonzo1971
3/17/2016
Hi,
pls try
value = 59
Console.WriteLine(value.ToString("00000.0"))
Select all
Open in new window
Regards
SStory
3/17/2016
This is true...use all 0 to avoid losing 0. ####0.0" will give you at least 0.0, and could give you more. 00000.0 will always give you all digits. For more information see Microsoft help on it.
https://msdn.microsoft.com/en-us/library/0c899ak8%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Jason
3/17/2016
ASKER
thks heap
msgbox(value.ToString("###