Solved

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

820 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