Tell me, I have the number 1 . 25, used double, so there it is necessary so 1 , 25, and which type is suitable?
Closed due to the fact that the essence of the issue is incomprehensible by the participants of Kromster , aleksandr barakin , Olter , Vladimir Glinskikh , Peter Olson 4 Aug '15 at 7:30 .
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
- oneclarify the question of what you do not like or what does not work in this type of record - Gorets
- I just need a number where there is no point ... but you can use a comma. - Angus123
3 answers
It is necessary to use the culture and class NumberFormatInfo to represent floating-point numbers in one form or another and with a particular separator.
More details in the article Standard Numeric Format Strings .
The article Culture Specific Number Formatting in ASP.NET has specific examples.
double number = 1.25; Console.WriteLine(number.ToString("G", CultureInfo.CreateSpecificCulture("ru-RU"))); // на консоле выйдет 1,25
There are other options, but is it really hard to read on MSDN yourself?
well, questions, use double or float (double is bigger in its range), and format the output as you want, period, comma ...
- oneCan you give an example? - Angus123 2:44 pm