Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

.NET Decimal Point Presentation

views
     
TSAnime4000
post Jun 9 2017, 10:58 PM, updated 7y ago

Regular
******
Senior Member
1,918 posts

Joined: Jul 2009
From: /dev/null


When I convert Float or Decimal data type, my friend at different country display wrongly, for example:

One Thousand Three Hundred Twenty Five:

1,325
1.325

after convert to strings, I pass this string to command-line arguments.
bandit9956
post Jun 10 2017, 12:36 AM

Getting Started
**
Junior Member
65 posts

Joined: Nov 2008
For java, you can convert with Locale as well.

Set Locale.getDefault() while converting will yield you correct.

I face this convert to KHMER and INDONESIA IDR.
Eventless
post Jun 10 2017, 12:41 AM

Look at all my stars!!
*******
Senior Member
2,641 posts

Joined: Jan 2003
Some countries uses the decimal point as a thousand separator and the comma as a decimal separator(1.234.567,89).
https://en.wikipedia.org/wiki/Decimal_mark#Countries_using_Arabic_numerals_with_decimal_comma
Your program is displaying the right format in those countries. When you run your program on your friend's computer, does it interpret the command line value correctly?
TSAnime4000
post Jun 10 2017, 07:52 PM

Regular
******
Senior Member
1,918 posts

Joined: Jul 2009
From: /dev/null


QUOTE(Eventless @ Jun 10 2017, 12:41 AM)
Some countries uses the decimal point as a thousand separator and the comma as a decimal separator(1.234.567,89).
https://en.wikipedia.org/wiki/Decimal_mark#Countries_using_Arabic_numerals_with_decimal_comma
Your program is displaying the right format in those countries. When you run your program on your friend's computer, does it interpret the command line value correctly?
*
I want to pass "Frame Rate", for example, 29.97fps, on those country become some what "29970"
Eventless
post Jun 10 2017, 09:20 PM

Look at all my stars!!
*******
Senior Member
2,641 posts

Joined: Jan 2003
QUOTE(Anime4000 @ Jun 10 2017, 07:52 PM)
I want to pass "Frame Rate", for example, 29.97fps, on those country become some what "29970"
*
The link below seems relevant to your problem.
https://stackoverflow.com/questions/2423377/what-is-the-invariant-culture

 

Change to:
| Lo-Fi Version
0.0110sec    0.39    5 queries    GZIP Disabled
Time is now: 29th March 2024 - 07:00 PM