I've got a float: 71.25
I want decimals to be a lot smaller on frontend and the only way I can think of is to "split" the float and do something like this:
<?php
$round = 71;
$decimals = 25;
?>
<p><?php echo $round . '.'; ?><small><?php echo $decimals; ?></small></p>
Float is output from mathematical equation, so there's no way to hard-code this situation.
How to achieve this with PHP? Im open to suggestions if there's a better way.
<?php
$float = 71.025;
$parts = explode('.', (string) $float);
print_r($parts);
Result array
Array
(
[0] => 71
[1] => 025
)