Try telling ruby that a variable contains the value 300.00, it will
say:
a = 300.00
=> 300.0
a
=> 300.0
And there’s your answer. You will have to tell Ruby that this is a so-
called “double”. to_d didn’t work in my local environment, but that
Ruby version is quite old. Try to to find how to convert your object
into a double.
Thanks all for your suggestions. It’s definitely dropping the final “0”
as Jaap suggested.
I think I can work around it by changing the regular expression to:
/\A[0-9]{1,5}.[0-9]{1,2}\Z/
Also just as a side note I’m new to Ruby / Rails having previously
worked with ColdFusion and Java, and I have to say this is a really
helpful community on this list. Great stuff.
Thanks all for your suggestions. It’s definitely dropping the final “0”
as Jaap suggested.
I think I can work around it by changing the regular expression to:
/\A[0-9]{1,5}.[0-9]{1,2}\Z/
Apparently you did not read my earlier post in this thread. Please do
so before you go further.
Also just as a side note I’m new to Ruby / Rails having previously
worked with ColdFusion and Java, and I have to say this is a really
helpful community on this list. Great stuff.
I’m a former CF developer myself. If there’s any way that I can provide
Rails insight on something CF-related, please feel free to ask.
I was able to successfully match the following cases:
300.00
123.00
123.11
300.01
That’s true. But if you actually take the time to read the entire
thread, you will find that the issue is elsewhere. Please actually read
the whole thread before posting.