Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/RTL/Delphi/Format + Float    [ Add a report in this area ]  
Report #:  67295   Status: Closed
FloatToStrF doesnt show euro sign with ffCurrency
Project:  Delphi Build #:  3170.16989
Version:    12.0 Submitted By:   Wouter de Jong
Report Type:  Basic functionality failure Date Reported:  9/29/2008 4:28:42 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    32 Bit Internal Tracking #:   265546
Resolution: Duplicate (Resolution Comments) Resolved in Build: : 12.0.3210.17555
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 7
When using FloatToStrF te euro character is not shown in the resulting string instead an other >128 character is shown.

In D2007 everything worked fine (UNICODE problem?!)

I'm using a dutch language version of Vista with default currency settings.
Steps to Reproduce:
  s : string;
  s := FloatToStrF(124.24,ffCurrency,15,2);

Doesn't produce € 124,24 as in D2007 but produces ¬ 124,24 instead.

Tomohiro Takahashi at 9/29/2008 5:33:34 AM -
Same problem occurs with Japanese environment, too.

Jani Jarvinen at 9/29/2008 11:11:52 PM -
This problem seems to affect all locales that use a currency symbol which require more than one byte to store the character.

The problem appears to be in the assembly language routine SysUtils.FloatToText. In this routine, there's a label called @@PutCurSym, marking the spot in which the currency symbol is added to the string. But, the instruction REP MOVSB is used there, which only moves one byte at a time.

For example with the Euro sign, this function results in bytes $AC,$00 appended to the string, which results in the errorneous Not Sign (U+00AC) being inserted.

The correct Unicode character for Euro should be U+20AC, or bytes $AC,$20. Maybe changing the assembly code line to REP MOVSW would correct this?

Also, this same problem affects the CurrToStrF function.

Tomohiro Takahashi at 3/9/2009 6:54:05 PM -
With 12.0.3210.17555, does this problem still occur?

Wouter de Jong at 3/11/2009 1:04:07 AM -
I've just tested it with CodeGear Delphi® 2009  Version 12.0.3210.17555 and it seems to work just fine now.

Tomohiro Takahashi at 3/11/2009 6:47:21 PM -
Thanks for confirmation.
I think this report should be closed.

Server Response from: ETNACODE01