Avatar of Jason
Jason
Flag for Australia asked on

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

Avatar of undefined
Last Comment
Jason

8/22/2022 - Mon
SStory

value=59
msgbox(value.ToString("####0.0", CultureInfo.InvariantCulture))
ASKER CERTIFIED SOLUTION
Éric Moreau

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

Hi,

pls try

value = 59
Console.WriteLine(value.ToString("00000.0"))

Open in new window

Regards
SStory

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

ASKER
thks heap