🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internationalization
Article #809

Re: Decimal point representation

#809
From: Oliver Rutsch
Date: Tue, 21 May 2002 07:12
39 lines
2748 bytes
Hi Pat,

PB wrote:

 > I have an application which processes floating point data which runs
 >  fine under a US/UK installation of Windows (any) but when run
 > under a European installation where the decimal separator is a
 > comma rather than a dot I get a "x.xx is not a valid floating point
 >  number" message.  The registry entry for the decimal separator is
 > sDecimal, but efforts to temporarily change this from a comma to a
 > dot (while I do my processing) on the fly fail miserably.  Any
 > ideas?
 >


Yes the dot-comma problem is really annoying, especially when using 
mixed up functions of the c-library (like sprintf, writes a dot) and 
Borland functions like TIniFile::WriteFloat (writes language specific 
decimal separators). Some programs (like MS-Excel) change the language 
layout back to the installation language while they are running! Try the 
following (on my german Win2000 computer): Switch to a different 
language, then start Excel. You will see that it will change the 
language temporarily to the original language. Close Excel and it will 
switch to the former language. Strange, isn't it ?
What we do in this case is that we are not expecting a special decimal 
separator. We write some functions like StringToDouble and 
DoubleToString who are working with every decimal separator and are 
using the dot internally. That was the only way to exchange exported 
files on computers with different language installations.

Hope that helps.

Bye,


-- 
Dipl. Ing. Oliver Rutsch
EMail: orutsch at sympatec.com
Sympatec GmbH Germany
Technical Details
Message-ID: <3CE9F371.5040106@sympatec.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3ce6c193$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10297d,6fd98b98999b57f8
X-Google-Attributes: gid10297d,public
X-Google-ArrivalTime: 2002-05-21 00:15:32 PST
Message-ID: <3CE9F371.5040106@sympatec.com>
Date: Tue, 21 May 2002 07:12:49 +0000
From: Oliver Rutsch <nospam@sympatec.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; QXW0330b) Gecko/20010726 Netscape6/6.1
X-Accept-Language: de-DE
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internationalization
Subject: Re: Decimal point representation
References: <3ce6c193$1_1@dnews>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Organization: Ye 'Ol Disorganized NNTPCache groupie
Cache-Post-Path: post.sympatec.net!unknown@rutsch2.tksympatec
X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/)
NNTP-Posting-Host: 217.6.163.138
X-Trace: dnews 1021965173 217.6.163.138 (21 May 2002 00:12:53 -0700)
Lines: 40
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews