Solved

Decimal separator:  how to know which one ('.' or ',') in an application

Posted on 1997-04-08
1
284 Views
Last Modified: 2013-12-03
My application is developped in PowerBuilder v5 and run on Win95 and WinNT.
Problem:  must know the decimal separator the user has setted on his machine.  Sometimes, the language is "French Canadian" and the default separator is ','.  Sometimes, it is "English US" and the default separator is '.'. But the user must have any combination of language/decimal separator.
Is there an API I can call  (I'm new to windows programming)?  If yes, which one and do I have to buy a library or something else ? Can I find the decimal separator in the registry?
0
Comment
Question by:Jocelyne
1 Comment
 
LVL 1

Accepted Solution

by:
bhoward earned 100 total points
ID: 1334472
Use the WinAPI function GetProfileString to read the sDecimal item from the [intl] section of the WIN.INI.  The item value will be a the string of characters that are used for the decimal separator.

There are several other items in that section that affect number formatting:

sCurrency (the currency symbol)
iCurrency (currency symbol position)
iCurrDigits (number of digits after decimal for currency)
iNegCurrency (formatting of negative currency values)
sThousand (thousands separator)
iDigits (number of digits after decimal for non-currency numbers)
iLzero (use leading zero for values between 1.0 and -1.0 exclusive)

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now