Solved

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

Posted on 1997-04-08
1
281 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

10 Experts available now in Live!

Get 1:1 Help Now