Currency values string split by comma

前端 未结 3 1567
情书的邮戳
情书的邮戳 2021-01-18 11:57

I have a String which contains formatted currency values like 45,890.00 and multiple values seperated by comma like 45,890.00,12,345.00,23,765.34,56,908.5

3条回答
  •  花落未央
    2021-01-18 12:39

    In all of the above solutions, it takes care if all values in the string are decimal values with a comma. What if the currency value string looks like this:

    String str = "1,123.67aed,34,234.000usd,1234euro";

    Here not all values are decimals. There should be a way to decide if the currency is in decimal or integer.

提交回复
热议问题