View Full Version : how to set the precision of the data saving into database
SBUH
August 23rd, 2003, 03:01 PM
hello, I am using sql server 2000 and using asp to insert into table. And I want to save the data from flash to database, in which there is xscale and yscale of the movieclip. They can be 5 or 6 decimals. How should I write the code to save them with 2 decimals. I don't know I should do this in asp code or do it in database ? Could anyone give some suggestion, thanks!!
Jubba
August 23rd, 2003, 03:05 PM
you should do the code in FLash and then send the info to the ASP script.
abzoid
August 23rd, 2003, 03:12 PM
If it were me, I'd do it within the ASP code before storing the values. The code below will do the trick. The "+ 0.5" takes care of the rounding up/down.
<%
xscale = Int(xscale * 100 + 0.5) / 100
yscale = Int(yscale * 100 + 0.5) / 100
%>
or you could use the equivalent math coding within the ActionScript. Hi Jubba :)
SBUH
August 23rd, 2003, 03:18 PM
thanks, I try it now
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.