Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
RTL
Delphi
Arithmetic
ConvUtils
Date - Time
DateUtils
File Management
Format + Float
Input/Output
Math Unit
Memory, Pointer, Address
Null-terminated strings
Other Classes
Other RTL
Pascal Strings
Regular Expressions
RTL Exceptions
Text Files
Thread support
Typed/Untyped Files
WinAPI
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/RTL/Delphi/Format + Float
[ Add a report in this area ]
Report #:
65102
Status:
Open
StrToFloat ignores ThousandSeparator
Project:
Delphi
Build #:
11.0.2902.10471
Version:
11.2
Submitted By:
Rune Moberg
Report Type:
Suggestion / Enhancement Request
Date Reported:
8/1/2008 5:39:15 AM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All platforms
Internal Tracking #:
263304
Resolution:
Duplicate
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
92265
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
StrToFloat completely ignores the current locale's ThousandSeparator. Raises EConvertError.
Steps to Reproduce:
function MyStrToFloat(const s: string): Extended;
var
FSet: TFormatSettings;
begin
GetLocaleFormatSettings(SUBLANG_NORWEGIAN_BOKMAL shl 10 + LANG_NORWEGIAN, FSet);
FSet.ThousandSeparator := '.'; // use Norwegian format settings, except ThousandSeparator = dot which is quite common
Result := StrToFloat(s, FSet);
end;
begin
WriteLn(MyStrToFloat('21.504,33'));
ReadLn;
end.
// exp: output 21504,33
// act: Project Project1.exe raised exception class EConvertError with message ''21.504,33' is not a valid floating point value'.
Workarounds
None
Attachment
None
Comments
Alexander Alexeev at 8/4/2008 7:06:53 PM
-
The similar QC report #64919: http://qc.codegear.com/wc/qcmain.aspx?d=64919
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us