# Specifying number of decimals to display on a numeric variable

**URL:** <https://forum.kirupa.com/t/specifying-number-of-decimals-to-display-on-a-numeric-variable/220729>\
**Category:** Uncategorized\
**Created:** [March 28, 2007, 7:21pm UTC](https://forum.kirupa.com/t/specifying-number-of-decimals-to-display-on-a-numeric-variable/220729 "2007-03-28T19:21:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalewb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dalewb/32/3029_2.png) [@dalewb](https://forum.kirupa.com/u/dalewb)\
**Post date:** [March 28, 2007, 7:21pm UTC](https://forum.kirupa.com/t/specifying-number-of-decimals-to-display-on-a-numeric-variable/220729/1 "2007-03-28T19:21:05Z")

</div>

An onLoadProgress listener object is returning a variable I am using to tell the user what percentage of the movie has been loaded. I am happy with the results of

```auto
myListener.onLoadProgress = function(empty10MC:MovieClip, loaded:Number, total:Number):Void{
    //setText();
    var percent:Number = loaded/total*100;
    loadingTxt.text = beginTxt + percent + endTxt;

```

, however the number returned is like 15 digits long! Is there any way I can limit the variable to display only 1 or 2 decimal places?
