# Adding values problems

**URL:** <https://forum.kirupa.com/t/adding-values-problems/179626>\
**Category:** Uncategorized\
**Created:** [February 21, 2006, 9:22pm UTC](https://forum.kirupa.com/t/adding-values-problems/179626 "2006-02-21T21:22:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![btapp](https://avatars.discourse-cdn.com/v4/letter/b/34f0e0/32.png) [@btapp](https://forum.kirupa.com/u/btapp)\
**Post date:** [February 21, 2006, 9:22pm UTC](https://forum.kirupa.com/t/adding-values-problems/179626/1 "2006-02-21T21:22:31Z")

</div>

I am new to actionscript and I’m having a problem with this code. The problem is the last line. I want the price to be displayed as the sum of the two values…however, right now it displays them next to one another. For example 30 + 10 = $40 (that’s what I want). It displays 30 + 10 = $3010.

Does anyone know how to fix this?

Here’s the code:

setPrice();  
function setPrice() {  
// Get the price (based on size list)  
var newPrice = sizeList.getValue();  
var newPrice2 = colorList.getValue();

BN.setAmount(newPrice + newPrice2);

thePrice = “$” + sizeList.getValue() + colorList.getValue();

}

Thanks!
