3 ms·
With ROR it might be transformed via the params parser. If you enter the code below in plain old Ruby environment, like irl or the console, it will properly par
by padseeker 4y ago
With ROR it might be transformed via the params parser. If you enter the code below in plain old Ruby environment, like irl or the console, it will properly parse it;
"3.9e3".to_f
=> 3900.0
Something happens when submitting web based params. I'd be curious to see what other back end languages and frameworks do.
- radiospiel 4y agoThis is what happens: "3.9e3".to_i => 3 and Integer("3.9e3") raises "invalid value for Integer()". Really, nothing to see here. Ruby just doesn't treat "3.9e3" as a valid string for an integer (which arguably is correct IMHO)