Tell me how to get 5% of the number 223.66 on php I am writing
$number = 223,66; $result = $number * 5 /100; But in the end it’s not how to fix it? Thank you, figured out!
Tell me how to get 5% of the number 223.66 on php I am writing
$number = 223,66; $result = $number * 5 /100; But in the end it’s not how to fix it? Thank you, figured out!
Forget about commas in real numbers.
$number = 223.66; $result = $number * 5 /100; Floating-point numbers (also known as "float", "double", or "real") can be defined with the following syntax:
<?php $a = 1.234; $b = 1.2e3; $c = 7E-10; ?> php.net> source
If you are not sure about the type, use the settype () function .
settype($your_value,"double"); Source: https://ru.stackoverflow.com/questions/623843/
All Articles
$number = 223.66; $result = $number * 0.05;. - user207618