Issue
Error code
java.lang.NumberFormatException: For input string: "44,379.3933"
at java.lang.Integer.parseInt(Integer.java:615)
at java.lang.Integer.parseInt(Integer.java:650)
This is written in Kotlin. How can I remove "," "." and "3933" from the input string?
val usdRate:String = (JSONObject(json).getJSONObject("bpi").getJSONObject("USD")["rate"] as String)
val text = usdRate.replace("\"", ".");
val satosh = text.toInt() / 100000000
Solution
usdRate.replace(",", "")
Answered By - AnxiousDino
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.