[dev] Best strategy to store money values

Jan Schneider jan at horde.org
Tue Aug 16 07:54:24 UTC 2011


Zitat von Luis Felipe Marzagao <lfbm.andamentos at gmail.com>:

> Hello:
>
> I´m using Horde_Rdo, which, by the way, is fantastic, in order to
> develop an app to control clients' credits and debits.
>
> My first impulse was to store the money amount of each transaction as
> decimal(10,2) (the backend I´m testing is mysql, but I´d like to keep
> things as abstracted as possible, taking advantage of Horde_Rdo).
>
> But then I got confused about what type of Horde_Form variable and
> column type (in migration style terms) should I use.
>
> I have never developed any app involving money values and
> calculations, so I could use some advice concerning the best
> strategy/practice before I invest time going the wrong direction.
>
> Any pointers are appreciated.

The form type should be "number", the column type "float".

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the dev mailing list