You need to sign in to do that
Don't have an account?
Makam Ruthvik
How to replace two characters of a String at the same time
Decimal d1 = 491345345.90;
System.debug(d1);
List<String> args = new String[]{'0','number','###,###,##0.00'};
String s = String.format(d1.format(), args);
System.debug(s);
Using this I was able to format the decimal.
Now I have to change to Netherlands currently i.e., replacing all the dots with commas and commas with dots.
How to change the string from 491,345,345.90 to 491.345.345,90 in one go
try following code. there was 4 conditions and we Handled it properly.if you want to check your answer then simply you have to replace y before split.
For example => 1. x.split(',');
2. y.split(',');
3. z.split(',');
4. w.split(',');
let me know if it helps you and don't forget to mark it as best answer.
Thank you
All Answers
try following code. there was 4 conditions and we Handled it properly.if you want to check your answer then simply you have to replace y before split.
For example => 1. x.split(',');
2. y.split(',');
3. z.split(',');
4. w.split(',');
let me know if it helps you and don't forget to mark it as best answer.
Thank you
HI veer soni
I got a very simple fix for it rather than going loops. But anyways thanks for giving me another approach.
Just for you information the below works just fine
OrderCashbackVal = OrderCashbackVal.replace(',', '@');
OrderCashbackVal = OrderCashbackVal.replace('.', ',');
OrderCashbackVal = OrderCashbackVal.replace('@', '.');