[Lazarus] Converting pence into pounds and then to string

Henry Vermaak henry.vermaak at gmail.com
Wed Dec 12 13:06:39 CET 2012


On Wed, Dec 12, 2012 at 11:23:46AM +0000, Richard Mace 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)

Format('%d.%.2d', [Price div 100, Price mod 100])

Henry




More information about the Lazarus mailing list