I'm trying to convert an classical integer value like:
2000
into a format like this:
2.000,00
I have tried the following methods:
String.valueOf(input.format());
And this method:
private String getCents(Decimal x){
String y = String.valueOf(x);
String z = '.';
if(y.contains(',')) z = ',';
y = y.substring(0, y.indexOf(z));
if(x - Decimal.valueOf(y) == 0)
return String.valueOf(x.format()) + z + '00';
else return String.valueOf(x.format());
}
But the string class doesn't contains the valueOf method for some reason. Is there any other way to do this ?