# Convert total to decimal

**URL:** <https://forum.kirupa.com/t/convert-total-to-decimal/291302>\
**Category:** flash\
**Created:** [June 27, 2009, 5:46pm UTC](https://forum.kirupa.com/t/convert-total-to-decimal/291302 "2009-06-27T17:46:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![puthem1st](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@puthem1st](https://forum.kirupa.com/u/puthem1st)\
**Post date:** [June 27, 2009, 5:46pm UTC](https://forum.kirupa.com/t/convert-total-to-decimal/291302/1 "2009-06-27T17:46:08Z")

</div>

Hello All,

I am having trouble converting my total price in the cart text field to decimal. I have on the main timeline I have a several numeric steppers and add to cart button.

In my .as file I have the following code that takes the price \* quantity and displays the total but not in the decimal $10.00 format. I have tried everything from Math.ceil, round, etc. It either will round up or just display the number with no decimal.

[COLOR=blue].AS File Code[/COLOR]

```auto

 
public function GetCartValue(decimals:Number) {
  var dataforAlternate = _level.BodyOilsMc.my_nstep.value;
  moneysign= "$";
  //trace("AS File"+""+dataforAlternate+" Products");
  WhiteAmberOil = 5.00;
  WhiteAmberOilTotal = (WhiteAmberOil*dataforAlternate);
  
  //trace(WhiteAmberOilTotal);
//CartCalc is the var for the text box that displays the total value once the add to cart button is selected
  _level0.CartCalc =(moneysign + WhiteAmberOilTotal);
  
  
  }
 

```

Any help is greatly appreciated!

Thank you!
