Jump to content

Advice please


Phpfr3ak

Recommended Posts

It could be done directly in the query, if you want to do it that way. It may end up being less code if you have a lot of values to display.

 

SELECT CONCAT('$', FORMAT(`field`, 2)) AS alias FROM `table` WHERE `some_field` = 'some_parameter'

 

EDIT: There may be other considerations, such as precision and rounding, no matter which method you use.

Link to comment
https://forums.phpfreaks.com/topic/215242-advice-please/#findComment-1119438
Share on other sites

Thanks for that i've done the following, only problem is it shows the noto as say 239,952,380.00 is there a way to remove the . as its not needed in the manner im using it and it looks out of place, thanks.

 

<?php echo number_format($data2['noto'], 2, '.', ','); ?></strong>xp)</span></td>

Link to comment
https://forums.phpfreaks.com/topic/215242-advice-please/#findComment-1119582
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.