-3

In PHP & javascript I need to get float after point values only. How to get that. E.g 1618867.7142857143 to 0.7 or 7 like this

dinesh balan
  • 318
  • 1
  • 14
  • 2
    [How much research effort is expected of Stack Overflow users?](https://meta.stackoverflow.com/a/261593/3082296) – adiga Dec 26 '22 at 07:08

1 Answers1

0
$number = 1618867.7142857143;
$decimal = $number % 1;

echo $decimal; // Outputs 0.7142857143
Nuhman Pk
  • 112
  • 7