Who Stole My Zeros?!

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 22, 2008   (RSS)

Re: [Perchpole] Who Stole My Zeros?!

By Dave - May 22, 2008

Hi Perch,

We're going to have to use a PHP function for this.

instead of this: <?php echo $record['weight'] * 5 ?>

try this: <?php echo number_format($record['weight'] * 5, 2) ?>

The ", 2" tells it to _always_ show 2 decimals, even then they're 00. This will also add thousands separators. So one million will display like this: 1,000,000.00. If it's a problem we can have it not add those. Let me know what works best for you.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Who Stole My Zeros?!

By Perchpole - May 22, 2008

Dave -

Seriously, you must stop eating that brainy food and give us mere mortals an opportunity to shine sometimes!

[tongue]

Thanks,

Perchpole