Hi!
when sending an extension request, Im trying:
var bet = 1;
var o ={};
o.bet = bet.toFixed(2); // also tried bet + 0.00
and sending it off in an extension request.
on the server I have params.getDouble("bet");
but it gives me a Integer to Double cast exception. any ideas on whats the proper way of sending it?
the only way I currently get it to work is if I do: bet + 0.0001 which is not right
Im using SFS2X 2.9.2
Javascript integer as double
Re: Javascript integer as double
Hi,
since Javascript doesn't support static types, they must be detected at runtime.
If a value doesn't have decimals it is considered and Int.
In this case I would probably recommend using Strings to avoid type cast problems on the server side.
What you did with the .toFixed(2) call is actually transforming the number to a String.
Hope it helps
since Javascript doesn't support static types, they must be detected at runtime.
If a value doesn't have decimals it is considered and Int.
In this case I would probably recommend using Strings to avoid type cast problems on the server side.
What you did with the .toFixed(2) call is actually transforming the number to a String.
Hope it helps
Return to “SFS2X HTML5 / JavaScript API”
Who is online
Users browsing this forum: No registered users and 35 guests