I have the following code:
function Extenso(nb: real); string;
var
total: real;
begin
total := Trunc(nb);
...
Result := ...;
end;
This function returns a string describing the number in full, for a country that has no cents, therefore the Trunc.
When input param nb comes in as 790209.00 (my error case, with decimals 0), strangely enough the result of Trunc is 790208 on debugger. Can someone please try to explain that ?!? I'm on Delphi XE3 update 2, with IDE fix pack 5.93, Windows 10 Pro 64.
Edit: as a clarification to the question, there's a business rule involved here, customer will accept rounds up to the result, but not down. Thanks @Dsm and @CraigYoung to your contributions.