BCDToStr gives wrong result
Original Reporter info from Mantis: Stephano
-
Reporter name:
Original Reporter info from Mantis: Stephano
- Reporter name:
Description:
The program below (attached as well) outputs 456 instead of 0.0456. The bug exists in FPC 2.7.1 as well.
Var
c1: currency;
tmpBCD: TBCD;
c2: currency;
ss: FmtBCDStringtype;
begin
c1 := 0.0456;
WriteLn(c1);
CurrToBCD( c1, tmpBCD, 32, 7 );
BCDToCurr( tmpBCD, c2 );
WriteLn(c2);
ss := BCDToStr( tmpBCD );
writeln(ss); // should output 0.0456 but outputs instead 456
end.
Mantis conversion info:
- Mantis ID: 25939
- Version: 2.6.3
- Fixed in version: 3.0.0
- Fixed in revision: 27846 (#6c7ab322)
- Target version: 3.0.0