1 year ago

#380123

test-img

uploak

How do I convert an abbreviated integer into an integer, in a string, in Java?

I have the following string as my input:

(100m/10k) * 10k

where

m = 1,000,000
k = 1,000

I expect an output of

(100000000/10000) * 10000

I'm having a difficult time figuring out how to replace the abbreviated integers with "real integers". I've tried looping through each of the characters in the string and finding the letters that have a corresponding integer and multiplying them with the integer before it, but I'm having trouble with finding the integer before the letter, and replacing/inserting it in the correct spot.

java

integer

equation

equation-solving

0 Answers

Your Answer

Accepted video resources