I'm doing some php math and need to divide a floating point number
variable by only 4 decimal places - when I do the following:
$aspect_ratio = 942 / 760;
$new_height = $target_width * $aspect_ratio;
In PHP $aspect_ratio claculates to 1.2394736842105 but for my purposes
I need only 1.2394
How can I limit the decimals to just 4 places?
Thanks...
variable by only 4 decimal places - when I do the following:
$aspect_ratio = 942 / 760;
$new_height = $target_width * $aspect_ratio;
In PHP $aspect_ratio claculates to 1.2394736842105 but for my purposes
I need only 1.2394
How can I limit the decimals to just 4 places?
Thanks...
Comment