[Lazarus] Converting an Integer of pence into pounds

Richard Mace richard.mace at gmail.com
Wed Sep 26 14:45:21 CEST 2012


Alex,
Thanks, that's exactly what I was trying to do!
I was using pounds := pence Div 100

Cheers

On 26 September 2012 13:37, Alexsander Rosa <alexsander.rosa at gmail.com>wrote:

> You mean:
>
> *var *pence: integer;
> pounds: currency;
> strval: string;
> *begin*
> pence := 650;
> pounds := pence / 100.0;
> strval := currtostr(pounds);
>
>
> 2012/9/26 Richard Mace <richard.mace at gmail.com>
>
>> Hi All,
>> I am having a bit of a mind block!
>> What would be the code to convert an Integer of pence e.g. 650 into a
>> value of pounds e.g. 6.50 and then convert to a string value of "6.50"?
>>
>> Thanks in advance
>>
>> Richard
>>
>>
>> --
>> _______________________________________________
>> Lazarus mailing list
>> Lazarus at lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>>
>
>
> --
> Atenciosamente,
> Alexsander da Rosa
>
>
>
> --
> _______________________________________________
> 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/20120926/738c4069/attachment-0003.html>


More information about the Lazarus mailing list