0
Imagine a string with the following value: 12,126456
How do I convert the string to 12.12?
I need to convert, using C#, so that the final string has at most two digits after the comma.
tried the String.Format("{0:#,00}", valor )
but it didn’t work.
Just to complement, if you want to give 12.12 you have to truncate the value before, since the formatting will use standard rounding.
– Maniero
I added the trunking part =] thanks @Maniero
– Rovann Linhalis
does not work with negative this method
– ihavenokia
@ihavenokia Solved the issue of the negatives
– Rovann Linhalis