Re: [PHP] Currency stored as cents

2005-07-03 Thread Marco Tabini
On 7/3/05 1:33 AM, "Tom Rogers" <[EMAIL PROTECTED]> wrote: > function dollars2cents($value){ > $value = sprintf("%0.2f",trim($value)); > list($a,$b) = explode('.',$value); > if(floatval($value)<0) $b = $b*-1; //negative amount? > return intval($a)*100 + intval($b); > } Have you tried

Re: [PHP] Currency stored as cents

2005-07-02 Thread Tom Rogers
Hi, Saturday, July 2, 2005, 6:57:07 PM, you wrote: S> The lack of a specific type to store monetary values is something of a S> problem with commercial applications. Be it that you have value added tax S> or sales tax to add per-item to an invoice or any other calculation like S> commissions, dis