You don't show the code for getFormattedAmount(), but I think the fix is to remove anything at the 6th digit and beyond, not just the 6th (last) digit.
a
Arpit Shukla
11/01/2021, 12:07 PM
Yeah, I had to rewrite the getFormattedAmount function to not depend upon previous input and format the given string independently. Seems to work now, will update the answer on SO shortly.