# How to set the precision of the data saving into database

**URL:** <https://forum.kirupa.com/t/how-to-set-the-precision-of-the-data-saving-into-database/29190>\
**Category:** Uncategorized\
**Created:** [August 23, 2003, 7:01pm UTC](https://forum.kirupa.com/t/how-to-set-the-precision-of-the-data-saving-into-database/29190 "2003-08-23T19:01:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SBUH](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@SBUH](https://forum.kirupa.com/u/SBUH)\
**Post date:** [August 23, 2003, 7:01pm UTC](https://forum.kirupa.com/t/how-to-set-the-precision-of-the-data-saving-into-database/29190/1 "2003-08-23T19:01:47Z")

</div>

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!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2003, 7:05pm UTC](https://forum.kirupa.com/t/how-to-set-the-precision-of-the-data-saving-into-database/29190/2 "2003-08-23T19:05:38Z")

</div>

you should do the code in FLash and then send the info to the ASP script.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2003, 7:12pm UTC](https://forum.kirupa.com/t/how-to-set-the-precision-of-the-data-saving-into-database/29190/3 "2003-08-23T19:12:05Z")

</div>

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  
%\>

[edit] or you could use the equivalent math coding within the ActionScript. Hi Jubba 🙂 [/edit]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2003, 7:18pm UTC](https://forum.kirupa.com/t/how-to-set-the-precision-of-the-data-saving-into-database/29190/4 "2003-08-23T19:18:01Z")

</div>

thanks, I try it now
