c# string format issue
Posted
by Kamal
on Stack Overflow
See other posts from Stack Overflow
or by Kamal
Published on 2010-03-19T09:27:57Z
Indexed on
2010/03/19
9:31 UTC
Read the original article
Hit count: 155
Hi guys
I need to convert a string to a monetary format of {###}.###.###,##
that is
a value of 5461497702600
would become
54.614.977.026,00
The numbers become excessively large.
I am using
return string.Format(string.Format("{0:#" + (val < 1000 ? "" : "\\.") + "##0.00}", val));
which returns for the example
54614977.026,00
(only one dot)
Any help would be appreciated
© Stack Overflow or respective owner