Is there an already existing solution that can parse all the numbers below?
"300.00"
"2.300,00"
"2,300.00"
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try using the
moneygem:$ gem install moneyThen you can do:
EDIT: the old
moneygem has split into two parts:moneyandmonetize. The newmoneyclass only handles creating, manipulating and converting currencies betweenmoneyobjects.To parse objects (including strings) into
moneyobjects, you should use themonetizegem instead: