[Lazarus] Converting pence into pounds and then to string

Kostas Michalopoulos badsectoracula at gmail.com
Wed Dec 12 12:54:10 CET 2012


Perhaps not the most efficient solution but that would do:

// p is the integer, f.e. 208
IntToStr(p div 100) + '.' + IntToStr((p mod 100) div 10) + IntToStr(p mod
10)




On Wed, Dec 12, 2012 at 12:23 PM, Richard Mace <richard.mace at gmail.com>wrote:

> Hi All,
> Got a simple question that has stumped me, which tends to happen if I
> don't do development for a couple of months.
>
> How's the best way of converting an integer number "208" (that is pence)
> into a string value that is in pounds (2.08)
>
> Thanks as always in advance.
>
> Richard
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20121212/a92a4844/attachment-0003.html>


More information about the Lazarus mailing list