Best way to get a dollar format
Posted: Thu Jan 13, 2005 11:02 am
I need to format some varchars in a dollar format and have been using
which has worked beautifully until this morning when I entered a value on my db of 20,000.00. It displays as $20.00 which obviously isn't right.
is there some built in function in php (like in cold fusion) for a dollar format? Or should I be using something different to format my varchars as dollar amounts?
What I don't want to do is force my numberformat to use more place holders and have something like $00020.00 for twenty dollars. Or the alternative, $20.00000 for twenty dollars.
please advise,
thx,
Burrito
Code: Select all
$<?=number_format($amount, 2, '.', '');?>is there some built in function in php (like in cold fusion) for a dollar format? Or should I be using something different to format my varchars as dollar amounts?
What I don't want to do is force my numberformat to use more place holders and have something like $00020.00 for twenty dollars. Or the alternative, $20.00000 for twenty dollars.
please advise,
thx,
Burrito