Skip to main content

How to get the decimalfractional 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. HoyHow can I do this? Is there any way to get this?

How to get the decimal 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. Hoy can I do this? Is there any way to get this?

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?

edited title
Link
David Cheng
  • 7.4k
  • 18
  • 55
  • 89

How to get the decimal parpart of a number in apex

Became Hot Network Question
edited tags
Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431
added 8 characters in body
Source Link
Sebastian Kessel
  • 13.2k
  • 12
  • 38
  • 61
Loading
Source Link
alejandro
  • 119
  • 2
  • 15
Loading