number_format
will always do that, your only solution is to feed it something different:
$number = intval(($number*100))/100;
Or:
$number = floor(($number*100))/100;
More Related Contents:
- Replace first word of sentence to the end if it is “the” [closed]
- Are global variables in PHP considered bad practice? If so, why?
- How to get body of a POST in php?
- Creating one array from another array in php [closed]
- Warning: mysqli_connect(): (HY000/2002): No such file or directory
- Convert number of minutes into hours & minutes using PHP
- Chrome net::ERR_INCOMPLETE_CHUNKED_ENCODING error
- array_unique for objects?
- PHP some $_POST values missing but are present in php://input
- PDO’s query vs execute
- Performance of try-catch in php
- dyld: Library not loaded: /usr/local/lib/libpng16.16.dylib with anything php related
- Pre-declare all private/local variables?
- Composer killed while updating
- How can we open a link in private browsing mode
- In PHP, how to detect the execution is from CLI mode or through browser ? [duplicate]
- Pull all images from a specified directory and then display them
- Return PHP object by index number (not name)
- How can I refresh a page when a database is updated?
- Redirecting to previous page after login?
- Unknown database error in PHP but it exists in PHPMyAdmin
- How to modify an array’s values by a foreach loop?
- Group 2d array data using column value to create a 3d array
- Call to undefined function session_register() [duplicate]
- While destructuring an array, can the same element value be accessed more than once?
- Customize addresses fields on WooCommerce My account and Checkout
- How to convert array to a string using methods other than JSON?
- Best way to initialize (empty) array in PHP
- Generate download file link in PHP [duplicate]
- Add a fee to an order programmatically in Woocommerce 3