Delphi - Checking length using pos -
i'm using code article:
how convert numbers (currency) words
i can't seem understand how following code works exactly.
try sintvalue := formatfloat('#,###', trunc(abs(number))); sdecvalue := copy(formatfloat('.#########', frac(abs(number))), 2); if (pos('e', sintvalue) > 0) // if number big begin result := 'error:'; exit; end; except result := 'error:'; exit; end; how checking if number big using pos() function? why searching e in integer? make no sense me. apprecaite explanation (the code works fine, want understand why , how).
the code checking use of scientific notation. write number 1000 '1e3'.
the code faintly ridiculous though. hard know why author did not use > comparison operator.
Comments
Post a Comment