Vuk Stanojevic

Vuk Stanojevic

  • 1.6k
  • 140
  • 45.6k

C# Decimal places

Nov 2 2020 4:51 AM
Hi everyone,
i have int for which i need to show two decimal places even number is wihtouth decimal part.
So for example if number is 123.0 i need to show it as 12300, if it is 345.67 i need to show it as 34567.
Then i need to convert it and show as string in order to apply Padding option.
Basically what i need is to show string 123 as 0000000012300 or 345.67 as 34567.
I try with 
String.Format("{0:n1}", value)

but it doesn't solve my problem.

Can you help please?
Thank you. 
 

Answers (5)