Hi all.
Recently, browsers have started sending fraction-numbers as values for the JavaScript-types event.pageX and event.pageY. This leads to inconsistencies when parsing with code like this:
...as this will fail for values with decimals, like 200.323221
Unfortunately parsing with JDouble doesn't always work either:
for {
JDouble(pageX) <- json \ "mouseCoordinates" \ "pageX"
JDouble(pageY) <- json \ "mouseCoordinates" \ "pageY"
} yield {...
as that fails when the client/browser sends the value as an Integer.
So - anyone knows what other frameworks do, when the value sent is "any number" (int or decimal)?
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963