S
Steve Peterson
Hi
I have an app where I have to deal with both Spanish & American formatting.
I have a string that represents a number that I need to convert to Int32
before I enter it in the database. The string can be any number, for
example, "1,355" (American style) or "1.355" (Spanish style) . I know could
use the Replace method and "strip" the number string of "." or the "," then
convert what is left to Int32.
But I thought maybe there is a better way using the CultureInfo class that
simply converts any culture number sting to a number. However, I'm having
problems figuring this one out.
Can anyone lend a helping hand?
TIA
Steve
I have an app where I have to deal with both Spanish & American formatting.
I have a string that represents a number that I need to convert to Int32
before I enter it in the database. The string can be any number, for
example, "1,355" (American style) or "1.355" (Spanish style) . I know could
use the Replace method and "strip" the number string of "." or the "," then
convert what is left to Int32.
But I thought maybe there is a better way using the CultureInfo class that
simply converts any culture number sting to a number. However, I'm having
problems figuring this one out.
Can anyone lend a helping hand?
TIA
Steve