# How can I divide these to values

**URL:** <https://forum.kirupa.com/t/how-can-i-divide-these-to-values/304814>\
**Category:** flash\
**Created:** [February 14, 2010, 8:05pm UTC](https://forum.kirupa.com/t/how-can-i-divide-these-to-values/304814 "2010-02-14T20:05:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fs\_tigre](https://avatars.discourse-cdn.com/v4/letter/f/edb3f5/32.png) [@fs\_tigre](https://forum.kirupa.com/u/fs_tigre)\
**Post date:** [February 14, 2010, 8:05pm UTC](https://forum.kirupa.com/t/how-can-i-divide-these-to-values/304814/1 "2010-02-14T20:05:33Z")

</div>

Hi,

I’m creating a small application and I’m having problems trying to divide the value from a textField.

What I have here are 4 inputFields and 2 textFields the problem is that when I try to divide the value from “totalYields” by 1 and display it on my ‘textField’ named “txtParts” it shows the same value on both textFields in other words it shows only the value from “totalYields” and ignores the operation.

This is the line I’m having problems with:

```auto
var totalParts:Number= Number(totalYields) / 1;

```

This is the complete code:

```auto
enterBtn.addEventListener(MouseEvent.CLICK, calculator,false,0,true);

function calculator(event:MouseEvent):void {
	
	var partW:Number=Number(partW_txt.text);
	var partL:Number=Number(partL_txt.text);
	var sheetW:Number=Number(sheetW_txt.text);
	var sheetL:Number=Number(sheetL_txt.text);
	var partsX:Number=partW / sheetW;
	var partsY:Number=partL / sheetL;
	var totalYields:Number = partsX * partsY;
	var totalParts:Number= Number(totalYields) / 1;

	txtYields.text=String(totalYields);
	txtParts.text=String(totalParts);
}

```

Can some be so kind and take a look at my code and let me know what the problem is? Why I can’t divide totalYields by 1 and show the result in my txtParts field?

```auto
var totalParts:Number= Number(totalYields) / 1;
txtParts.text=String(totalParts)

```
