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
--
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.m...@gmail.comwrote:
Hi All,
Got a simple question that has stumped
On 2012-12-12 11:23, Richard Mace wrote:
How's the best way of converting an integer number 208 (that is pence)
into a string value that is in pounds (2.08)
Divide by 100. Then use FormatFloat() to output as string.
Regards,
- Graeme -
--
fpGUI Toolkit - a cross-platform GUI toolkit
On Wed, Dec 12, 2012 at 11:23:46AM +, 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
On 12/12/2012 11:23, 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)
Thanks as
Guy's,
Thanks for the quick info. It's brilliant to get so many good answers do
quickly.
Richard
On 12 December 2012 12:17, Lukasz Sokol el.es...@gmail.com wrote:
On 12/12/2012 11:23, Richard Mace wrote:
Hi All, Got a simple question that has stumped me, which tends to
happen if I don't
Am 12.12.2012 13:17 schrieb Lukasz Sokol el.es...@gmail.com:
On 12/12/2012 11:23, 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
How's the best way of converting an integer number 208 (that is
pence) into a string value that is in pounds (2.08)
Here's another variant that provides an optional $, £ or €
uses math;
function PenceToString(pennies: integer; precision: integer=2;
currency:
On 12/12/2012 15:21, Howard Page-Clark wrote:
How's the best way of converting an integer number 208 (that is
pence) into a string value that is in pounds (2.08)
Here's another variant that provides an optional $, £ or €
uses math;
function PenceToString(pennies: integer; precision:
On 12/12/2012 15:42, Lukasz Sokol wrote:
On 12/12/2012 15:21, Howard Page-Clark wrote:
How's the best way of converting an integer number 208 (that is
pence) into a string value that is in pounds (2.08)
Here's another variant that provides an optional $, £ or €
uses math;
function
On 12/12/2012 15:45, Lukasz Sokol wrote:
Format('%s%%.%df',[currency, precision]),[pennies/(10**precision)]);
Fat fingers L(
Format(Format('%s%%.%df',[currency, precision]),[pennies/(10**precision)]);
of course!
No ?
:)
Lukasz
--
Howard Page-Clark wrote:
How's the best way of converting an integer number 208 (that is
pence) into a string value that is in pounds (2.08)
Here's another variant that provides an optional $, £ or €
uses math;
function PenceToString(pennies: integer; precision: integer=2;
On Wed, Dec 12, 2012 at 11:23:46AM +, Richard Mace wrote:
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)
13 matches
Mail list logo