Thousand separator: "." (dot) Decimal separator: "," (comma). I live in Italy.
I'm getting from API this value (it's a string):
"balance":"1254.00".
In a case I need to convert it in an integer value:
1.254
without the decimal part (also if it is not zero, without round up or down).
In another case I could have (it's a string):
"balance":"1234.56"
And in that case I need
1.234,56
Going crazy with several functions, not getting my goal.
E.g. I tried:
NumberFormat numberFormat = new DecimalFormat("#,##");
BigDecimal balance_numeric = new BigDecimal(this.raw_balance.replaceAll(",", ""));
balance = String.valueOf(numberFormat.format(balance_numeric));
And getting for first case (1254
) an 12,54
, no sense for me.
Thank you very much.