ruby-units icon indicating copy to clipboard operation
ruby-units copied to clipboard

Fix currency parsing stack limit too deep error

Open ahacking opened this issue 11 years ago • 5 comments

Attempting to parse Unit('$1.45') throws a 'stack limit reached' error.

  • Fixed parse_into_numbers_and_units to account for leading '$'
  • Added test for currency parsing

ahacking avatar Aug 21 '14 12:08 ahacking

+1

rposborne avatar Jan 08 '15 22:01 rposborne

@olbrich any chance this will be addressed in the 2.0 release?

rposborne avatar Nov 13 '15 16:11 rposborne

@rposborne I'm in the process of completely rewriting the parsing engine. I did come across the problems with currency already and have it working. Also included is the ability to parse currency in formats like $1,000,000 and ($1,000) (for negative numbers).

olbrich avatar Nov 19 '15 21:11 olbrich

@olbrich fantastic. You have done some great work with this gem!

rposborne avatar Nov 19 '15 22:11 rposborne

@olbrich I appreciate all of your work on this gem. Is there any update on when a new version may be published with a fix for this issue?

alecdotninja avatar Sep 20 '18 05:09 alecdotninja

This has been fixed for a while, I just neglected to close it.

olbrich avatar Jan 14 '23 14:01 olbrich