Forum Moderators: coopster
The prices are sent from a form using POST data. This is the put in the db via SQL.
When I come to retrieve the prices and show them on a PHP page they display wrongly e.g. 100.00 would show as 100.0000 or 134.50 would show as 134.5000.
They are correct in the actual db when viewed in Access, ie they have 2 decimal places.
I suppose I could strip the last two zeros off the string, but would like to get the bottom of it.
Any ideas anyone?
<?php$number = 1234.56;
// english notation (default)
$english_format_number = number_format($number);
// 1,234// French notation
$nombre_format_francais = number_format($number, 2, ',', ' ');
// 1 234,56$number = 1234.5678;
// english notation without thousands seperator
$english_format_number = number_format($number, 2, '.', '');
// 1234.57?>