calculate

age calculation in Flex

I'm trying to calculate age in flex. I've found this previous question http://stackoverflow.com/questions/41763/what-is-the-best-way-to-calculate-age-using-flex I'm sort of leaning towards this private function calculateAge(dob:Date):String { var now:Date = new Date(); var ageDays:int = 0; var ageYears:int = 0; var ageRmdr:in...

Calculating the average

This is a related question to one I posted earlier... I'm trying to sum all the input elements that begin with 'pull' and place that total in the 'totalpull' input field. I have that part working. Now, I'm trying to calculate the average if a user enters something manually in the 'totalpull' input field and set each 'pull' input to tha...

Calculate the number of Tweets in PHP

I want to calculate the number of Tweets of a Twitter Search, and a countup. Just like GigaTweet. How can I calculate this using PHP and the Twitter API? ...

How do I make JavaScript to set these element values?

I have two fields that need to multiply each other and fill a 3rd form's value. Here's the HTML: <input type="text" name="estimate[concrete][price]" value="" onBlur="calc_concreteprice(document.forms.mainform);" /> per SF <strong>times</strong> <input type="text" name="estimate[concrete][sqft]" value="" onBlur="calc_concreteprice(...

How to calculate totals with smarty php

Hi, I have a list of "before discount" prices on my checkout, I want to calculate the total amount of these in a new div at the bottom.. Any ideas? What I want to calculate: {if $item.Product.formattedListPrice} <div id="salg" title="Rabatt"></div> {/if} <div id="cart2Salg"> {if $item.Product.formattedListPrice} <span class="listP...

How to calculate columns in datagridview

I am new to C#. I have a datagridview with 3 columns. AmountPaid/TotalDue/BalanceDue. I am simply trying to subtract the value of AmountPaid column/cells from TotalDue column/cells and place the result in BalanceDue column/cells. Any code help or links would be appreciated. Thanks Oceantrain ...

What webservices are available to obtain miles between two addresses?

Hi, I need to find a way to get miles (not a straight line) between two locations by passing the post addresses. If you consider the simplicity of implementation, efficiency and stability, which webservice(s) you can suggest? I would appreciate if you know any possible comparison list of relevant web-services. Thanks ...

How to do simple math in datagridview

I am new to C#. I have a datagridview with 9 columns. I am simply trying take the value in column 5 and subtract it from column 6. Then display the result in column 9. It seems simple enough.I know it's done in excel all the time. But I just cannot figure this out. Do I need to create a new class with a method called calculate columns? o...

php calculate float HELP!!

help!! i have weird math calculation here. hope someone will explain. $a = 1.85/100; $b = 1.5/100; $c = 1.1/100; $d = 0.4/100; $e = 0.4/100; $f = 0.4/100; $g = 0.4/100; $h = $a + $b + $c + $d + $e + $f + $g; echo $h*100 ."<br>"; $i = $h-$a; $i = $i-$b; $i = $i-$c; $i = $i-$d; $i = $i-$e; $i = $i-$f; $i = $i-$g; echo $i; last $i val...

How to calculate the entropy of a source ?

How to calculate the entropy of a source? Is there a uniform algorithm how to calculate the entropy of a source e.g. mouse mouvments or keystrokes? ...

Adding Mysql Columns in Rails Rake

I have a rake file that does a series of calculations on a database. Basically it adds usage on equipment regularly. At the end of the day it needs to add that days total to a monthly total table and update that same table. i use the following simple concepts: To get data from the database is pretty simple: @usages = Usage.find(:all)...

How can I get the x/y coordinates of an SVG element(path etc) that does not have the X/Y attributes?

Hi! I am trying to get the position of SVG elements using Javascript. I have managed to get the position on elements that have X/Y attribute set. But elements, such as paths does not have this attribute.. At least not in my docuements. Is there a way to calculate the position other than taking the first number in the "path"? Thank you...

Convert time to decimals in .net

Is there an easy way to present time (hh:mm) as a decimal value? Example, 01:08 should become 1,13. I have an asp:textbox masked (ajax) as time with the mask format "99:99". Next to this box I need to present the entered value as decimal. <asp:TextBox ID="time" runat="server" /> hh:mm ([time in decimal format]) <ajaxToolkit:MaskedEdi...

How to calculate a subnet mask from IP address?

I just want to understand how this software works: http://www.subnet-calculator.com/ ...

Format number as I type Expand this post

Hi I am working on an app at the moment that requires number input to be formatted as the textfield changes as well as perform a calculation. I have the text fields set up so that as the user types notifications are passed out and a calculation is performed. However what I need to do now is format the text to be in this style: €1,000,000...

How to calculate paypal fees, 2.9% +0.30 doesn't work for some cases variable FEEAMT in checkout method doesn't match

Hello to everyone, thanks for reading this. I am implementing paypal checkout in my website it is working but i want to make a simple fees calculator for paypal in order to help the user, i went to paypal and they said their fees amount is 2.9% +0.30 fixed, but it is not working for some cases, for example: deposit $1.34 2.9 % = $0.04 ...

Calculating total width of all list items?

Hi There, I have a standard UL as follows: <ul> <li><a href="">Link</a></li> <li><a href="">Link</a></li> <li><a href="">Link</a></li> <li><a href="">Link</a></li> <li><a href="">Link</a></li> </ul> I am trying to find a quick & efficient way to calculate the combined with of all the LI tags. Currently I have: var width = ...

auto calculate the sum of input values with javascript

I've an html page which has many dynamically created input boxes. The number of text boxes vary each time. I want to calculate the sum of the numbers the user has entered, and disply it. When the user delete one number the sum should auto calculate. How can i do it with javascript? Thanks ...

PHP: How to get age in php from day, month, year ?

I have 3 variables $day, $month, $year each of them have the values what the users given to them. I want to get his real Age too from these 3 variables. For example the user enters this date for his birthdate in this format day,month,year: 04, 07, 1990 -> Now his age is 19 02, 07, 1990 -> Now his age is 20 I want to have i...

jQuery: Count children of several elements and calculate

Hi there I'm making a website for a restaurant, where they want to make "room" in the menu, by starting the numbering with the following "5". Example: Starter 1. 2. Salads 5. 6. 7. 8. 9. 10. 11. Pizza 15. 17. I want to count the numbers of TABLEs within a DIV, give the tables this number, then count the number of TRs within the TAB...