0

i have a question

in Indonesia, we usually use 8,5 not 8.5 but when i write 8,5 in textbox it mean 85

how to solve it? simply i want to change the dot with commas

piokuc
  • 25,594
  • 11
  • 72
  • 102
Alvin Christian
  • 153
  • 1
  • 1
  • 8

1 Answers1

5

You are probably using double.TryParse somewhere. Switch to this overload and pass in an Indonesian culture for the provider parameter using new CultureInfo("id-ID").

Example with double.Parse:

double result = double.Parse("6,5", new CultureInfo("id-ID"));
Jon
  • 428,835
  • 81
  • 738
  • 806