Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-09

Converting an Integer of pence into pounds

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexsander Rosa
to Richard Mace

You mean:

*var *pence: integer;
pounds: currency;
strval: string;
*begin*
pence := 650;
pounds := pence / 100.0;
strval := currtostr(pounds);

2012/9/26 Richard Mace

Show quoted text 17 lines
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 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Atenciosamente, Alexsander da Rosa -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120926/1504a7c9/attachment.html>

Reply by email

Richard Mace
to Alexsander Rosa

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

Cheers

Alexsander Rosa wrote 45 lines
You mean: *var *pence: integer; pounds: currency; strval: string; *begin* pence := 650; pounds := pence / 100.0; strval := currtostr(pounds); 2012/9/26 Richard Mace > 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 > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > > -- Atenciosamente, Alexsander da Rosa -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120926/738c4069/attachment.html>

Reply by email

wildfire
to Richard Mace

----- Original Message -----
From: Richard Mace
To: Lazarus mailing list
Sent: Wednesday, September 26, 2012 1:45 PM
Subject: Re: [Lazarus] Converting an Integer of pence into pounds

  Alex,
  Thanks, that's exactly what I was trying to do!
  I was using pounds := pence Div 100
  Cheers
  Which would work with Pennies := pence MOD 100

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120926/eb505e88/attachment-0001.html>

Reply by email