 ShowAll Questionssorted byDate Posted Prem Chauhan

# how to convert decimal numbers like (1234.12) to words in salesforce??

how to convert decimal numbers like (1234.12) to words in salesforce??

I need an output like this...

1234.12 = one thousand two hundred thirty-four. twelve paise (INR)
I am getting this much of output 'one thousand two hundred thirty-four' but not getting how to append that "twelve paise" after the decimal point. Best Answer chosen by Prem Chauhan YogeshMore
Hi Prem,

If you are getting required out put before dot, then following solution helps you to achieve your requirement by splitting the value.
For example, you have value like 1234.12.
```Decimal Num = 1234.12; // This is your Number
String strVal = String.ValueOf(Num); // Convert Number to string
List<String> lstNum = strVal.Split(‘.’); // Split number by dot, List size will be two.
String NumberToString = ‘’;
If(lstNum.size()>0){`
String NumberToString1 = CallYourNumberToStrimgMethod(lstNum);// Get Number to String of before decimal place.
String NumberToString2 = CallYourNumberToStrimgMethod(lstNum);// Get Number to String of after decimal place.
NumberToString = NumberToString1 + NumberToString2; // here you will get exact out put.
}```

Regards,
Yogesh More

Salesforce consultant || Salesforce Developer
more.yogesh422@gmail.com || Skype:-yogesh.more44​ YogeshMore
Hi Prem,

If you are getting required out put before dot, then following solution helps you to achieve your requirement by splitting the value.
For example, you have value like 1234.12.
```Decimal Num = 1234.12; // This is your Number
String strVal = String.ValueOf(Num); // Convert Number to string
List<String> lstNum = strVal.Split(‘.’); // Split number by dot, List size will be two.
String NumberToString = ‘’;
If(lstNum.size()>0){`
String NumberToString1 = CallYourNumberToStrimgMethod(lstNum);// Get Number to String of before decimal place.
String NumberToString2 = CallYourNumberToStrimgMethod(lstNum);// Get Number to String of after decimal place.
NumberToString = NumberToString1 + NumberToString2; // here you will get exact out put.
}``` Ram2026