# Doing math in ActionScript

**URL:** <https://forum.kirupa.com/t/doing-math-in-actionscript/280611>\
**Category:** flash\
**Created:** [January 29, 2009, 1:19pm UTC](https://forum.kirupa.com/t/doing-math-in-actionscript/280611 "2009-01-29T13:19:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drew91](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@Drew91](https://forum.kirupa.com/u/Drew91)\
**Post date:** [January 29, 2009, 1:19pm UTC](https://forum.kirupa.com/t/doing-math-in-actionscript/280611/1 "2009-01-29T13:19:27Z")

</div>

What I’m shooting for here is averaging values, based on two other values that I enter in two different text values.  
Example:

Games Played: 10  
Points: 50

Points Per Game: 5.0

How would I code it so that when those two values are entered, the “Points Per Game” is automatically calculated?
