Skip to main content

How to get the fractional part of a number in apex

I need to get the number after de decimal point. For example I have:

344.567

And I need to get in a variable 567.

I've tried the next:

decimal d=43.3432332343344;

String s = String.valueOf(aa);

String[] arrayDecimal = s.split('.');

But the result is an empty array. How can I do this? Is there any way to get this?

alejandro
  • 119
  • 2
  • 15