[eluser]TheFuzzy0ne[/eluser]
Multiplying it by 100 will shift the decimal place over to the right by two spaces. This won't work, however, if you have a number such as 0.376, which will generate 37.6.
Another solution might be to just use a regular expression. Something like:
Code:
$number = 0.37;
$pattern = '.+\.([0-9]+)';
if (eregi($pattern, $number, $matches)) {
$number = $matches[1];
}
echo $number;
this will work no matter how many decimal places you have, however, if you are interested in only the first 2 decimal places, multiplying by 100, and then using floor() should work for you. Like this:
Code:
$number = 0.37;
$number = floor($number*100);
EDIT: You can also use ceil() or round(), depending on what exactly it is you need.