I have a String and i need to convert it into Currency format in RUBY and
verify whether it matches to the expected.
String = "$6,178.50 USD / 22,693.01 AED"
I want to split it into 2 different variables like
usa_price = $6,178.50
aed_price = 22,693.01
expected_output= $6,178.50 * 3.67 = 22,693.01 (should match value in AED)
I tried doing gsub/scan and im confused now, what’s the best way to
achieve this in Ruby!!!
If you’re sure that first number is USD and second number is AED and the order won’t change then: