Solved

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

Posted on 1997-04-08
1
288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Title # Comments Views Activity
Event ID 10010 3 81
Windows Drag & Drop Location 2 117
Best way to accomplish this task? 3 97
WPF issue with Trigger 2 150
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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

752 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