vendredi 20 février 2015

How to convert string into decimal?

I text box i have a value:



1212,12


Additionally my text box have a mask:



MaskType=Numeric
EditMask='n2'


i try to parse it:



var culture = CultureInfo.CreateSpecificCulture("en-US");
var value = decimal.Parse(myTextBox.Text, culture);


but get value=121212 when expected value=1212.12


What can be wrong?


Aucun commentaire:

Enregistrer un commentaire