| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Toys in the Attic...
|
In a best practice/"cleanest code possible" type scenario, would you stop to evaluate whether a number contained a decimal before you did a parseFloat on it?
I'm parsing user entered equations, and since they can enter a decimal, I currently have it just parseFloat-ing eveything to be safe. Since my App does not perform these equations rapidly, I can't imagine it would really matter performance-wise, but I'm wondering if practices would suggest that I only use pInt on ints and pFloat on dec... Any thoughts?
__________________
Just one dimension shy of a career in 3d gaming. |
|
|
|
|
|
#2 |
|
Site Contributor
Join Date: Jun 2008
Location: Brooklyn
Posts: 311
|
If the users have entered a number, go with number. why over think it?
![]() |
|
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| decimal number to binary number ? | baby_annie | Other Flash General Questions | 11 | 03-29-2004 05:12 AM |
| Problem with addition and number validation | Denaes | ActionScript 2.0 | 2 | 10-07-2003 02:39 PM |
| getting numbered values from array | linckx | ActionScript 1.0 (and below) | 14 | 06-24-2003 12:21 AM |
| load vars from text file as a number (int, float...) | tnicolas | ActionScript 1.0 (and below) | 3 | 08-05-2002 09:59 PM |
| Random number | bruceleecutie | ActionScript 1.0 (and below) | 1 | 02-18-2002 03:51 PM |