ActionScript 2.0 :: Convert Decimal Number To Scientific Notation?

Jul 21, 2010

I've got a calculator that i created in as2 that converts different units of measurement. However, right now it always converts the numbers into a decimal number like 0.33333333 or 450.72. How in the world would i convert these decimal numbers to scientific notation? For example, say i have a number: 12,700. Expressed in scientific notation, this would be 1.27x10^4.I hope there is an easy way to make flash convert to such a number system? I know its easy to round numbers in decimal, but have never worked with scientific notation before.

View 9 Replies


Similar Posts:


ActionScript 3.0 :: Scientific Notation In Conditionals

Nov 16, 2010

I have the following: ActionScript Code: if ((player.charVelocity < 9.0180945396304027e-26 && player.charVelocity > -9.0180945396304027e-26)) it seems to be firing as soon as charVelocity gets between 1 and -1. Am I writing that correctly? I assume it would work as I copied the syntax it was outputting for the variable value (which is set to 'int')

View 5 Replies

ActionScript 2.0 :: Method To Check If A Number Is A Decimal Number?

Jan 20, 2006

there is any method to check if a number is a decimal number or not? i searched in the help-panel, but didn't found something.

View 6 Replies

ActionScript 2.0 :: Convert Decimal To Hexadecimal

Sep 13, 2001

how to convert a decimal value to a hexadecimal with actionscript...

I want to make a funtion which will assign a random color to a movieclip... And the "set rgb" function requires the variable passed to be in hex. Bummer.

Also I could solve this problem if I could convert a string to a hex number insted of a decimal like with parseInt()

I think the solution may lie within the bitwise operators >> and <<, etc,... But I have no clue as to their use...

View 5 Replies

ActionScript 3.0 :: Possible To Convert Decimal To Binary?

Mar 19, 2012

I would like to know if you can convert decimal to binary using actionscript 3.0?

View 6 Replies

ActionScript 3.0 :: Convert Decimal To Fraction

Sep 8, 2009

I'm not familiar with actionscript 3.0, but I must use it for a project I was assigned. The final product will be a program that will take a decimal input value and then convert it to a fraction. I have searched the web for a couple hours now and have found very useful info on this topic in the actionscript 2.0 forum, but nothing for 3.0.providing a function that will convert a decimal value to a fraction?

View 2 Replies

ActionScript 2.0 :: Convert Decimal Minutes Like 90 -> 1:30?

Dec 11, 2002

I need to make a dynamic text field display Sound.duration like 1:30sec instead of 90sec (for exemple...). I was not a maths major... I studied that long ago... I think... But I have no clue...

View 8 Replies

ActionScript 2.0 :: Convert Character To Decimal?

Apr 9, 2007

I can't seem to find a function to convert a character to a decimal.

Example: Convert string 'A' into its decimal form '65'.

Background: I'm trying to take an input character value (anything from a to ZZ), substring its characters, and into uppercase (eg. G, Z), covert each character to decimal (eg. 71, 90) and then reduce those numbers, such that A=0, B=1, Z = 25 and finally add them. GZ = 6+25 = 31.

It's for an X,Y co-ord system that uses A-ZZ for X, and numbers for Y.

View 7 Replies

ActionScript 2.0 :: Convert Total To Decimal?

Jun 27, 2009

I am having trouble converting my total price in the cart text field to decimal. I have on the main timeline I have a several numeric steppers and add to cart button.

In my .as file I have the following code that takes the price * quantity and displays the total but not in the decimal $10.00 format. I have tried everything from Math.ceil, round, etc. It either will round up or just display the number with no decimal.

.AS File Code

Code:

public function GetCartValue(decimals:Number) {
var dataforAlternate = _level.BodyOilsMc.my_nstep.value;
moneysign= "$";
//trace("AS File"+""+dataforAlternate+" Products");

[Code].....

View 4 Replies

Convert Variable To Money With 2 Decimal Places?

May 6, 2010

I have a program that adds values together. I need the variable to display with 2 decimal places. Right now $1.50 would look like: 1.5

How do I make Flash display the zero automatically?

View 2 Replies

ActionScript 3.0 :: Convert Decimal To Binary Ive Got The Formula?

Mar 19, 2012

Im having a problem with this code to convert decimal to binary ive got the formula but it wont print to the screen_txt only on the console and also my calculator wont let me change any other number other than 3 so if i press 7 binary should be 111 but it stays 11...

[Code]...

View 3 Replies

ActionScript 3.0 :: How To Convert Base 10 Decimal To Twips

Mar 17, 2009

Basically, I am experiencing an inconsistency with the behavior of an equation that is calculating the change in y position from one movieclip sequentially from frame to frame, and transforming the amount of change from a smaller range to an amount of change to a larger range; moving the target mc between two points. The inconsistency is that target mc doesn't always reach the top and bottom .y points, even though the slider mc does.

View 2 Replies

ActionScript 2.0 :: [FMX] Convert Decimal Time To Standard Format?

Sep 19, 2005

I am trying to do a calculation which will eventually (hopefully) yield the total length of time it will take to download a certain size file over different broadband speeds.

//amount_total is the total file size (GB)
//multiplied by 1024 to give me total megabytes
mb = Number (amount_total*1024)
//15 is time (s) to download 1MB

[code]....

So, I am left with a total time of eg: 4.5 hours.i would like a standard number I can use across my movie to convert 4.5 hours to 4hrs 30, or 4.30 for simplicity.If I have 0.5 hours as a total, it would be much easier for the user to read it .30 hours.

View 7 Replies

ActionScript 2.0 :: X, Y To GPS - Convert A Decimal Value (like 10.25) Back To Degrees And Hours?

Apr 18, 2006

if I have a map of say, Wisconsin, and I know what the Latitude coords (degrees, hours, minutes) of the top and bottom of the map, and I know how many pixels tall the map is, then I should be able to convert, with math, degrees:hours:mins to pixels. (same thing with longitude, but lets just focus on one way first)

I would first find out how may hours (minutes would be over kill for my app) there are to a pixel. Thats pretty easy. But this gives me a decimal number. How do i convert a decimal value (like 10.25) back to degrees and hours (in other words, how do i make .25 a "60" based value)? Ultimately, i want the user to be able to input coords in the form of degrees, hours, mins. Then convert that to X, Y (to place a marker on the map).

Has any one had experience with this or know how to do this?

View 3 Replies

ActionScript 3.0 :: Convert Decimal To Hexadecimal And Vice Versa?

Jun 15, 2011

I have started working with colors and have got a need for playing with hexadecimals. I tried making a variable which adds two hexadecimals, and it works but when I trace the answer, it comes out in decimals. How can I make it remain in hexadecimal or convert the decimal to hexadecimal?

View 6 Replies

ActionScript 3.0 :: Set Decimal In Floating Number

Nov 16, 2009

i have value of have long number after decimal. Now, I want to control in 3 digit after decimal. How could i do.

View 1 Replies

ActionScript 3.0 :: Set Decimal In Floating Number?

Nov 16, 2009

here i have value of have long number after decimal. Now, I want to control in 3 digit after decimal. How could i do

Ex:
Problem = 9.982540214587
Want = 9.982

View 3 Replies

ActionScript 3.0 :: Get Decimal Part As Whole Number?

Jun 27, 2011

I want to get decimal part of the number in this case 67 (number = 67 ) First problem is internal calculations

ActionScript Code:
var number:Number = 987123456.67;
var intNum:Number = Math.floor(number);
var decimal = parseFloat(String(number - intNum));
trace(decimal); //outputs 0.6699999570846558, instead of 0.67

I wonder is there a any way to doit besides using toString?

View 9 Replies

ActionScript 2.0 :: Rounding A Number To Have No Decimal?

Mar 22, 2012

I'm making a game where you level up, and then the amount of EXP you need to level up, gets higher. The problem is, if I have it so the amount of EXP needed to get to the next level just multiply by 2, it just gets to an absurdly high number, and I don't want that. I would rather have it multiply by 1.3 or 1.5, but the problem with that is that the right side of the decimal gets all ugly to something like "60.54902380".

how would I be able to round it so there's no decimal point, or at best just one number to the right?

View 2 Replies

ActionScript 2.0 :: Set A Number To 2 Decimal Places?

Aug 27, 2005

how do you set a number to 2 decimal places??

View 7 Replies

ActionScript 2.0 :: Rounding Off Decimal Number?

Sep 12, 2006

How can I round off a decimal number upto say three decimal places? The number comes as an output value like 0.98765e^7 for the statement outputvalue = 0.8678/InputValue. How can I make the output value rounded off as 0.988e^7?

View 7 Replies

ActionScript 2.0 :: How To Get Simple Decimal Number

Feb 22, 2010

I want to get rounded number
Example:
I want to get full number I write
Code:
cas=15.02
int(cas)
and I get 15

But when I write these
Code:
cas=15.02
lol=cas - int(cas)
trace(lol)
I get 0.0199999999999996 instead of 0.02. I need to get only decimals so that i will be able to write 15.02 like 15:02 or 1.2 like 01:20. I need to write numbers like in digital clock.

View 8 Replies

Actionscript :: Convert Character Entity References Into Decimal (charCodes) In It?

May 10, 2011

Is there a native method for converting character entity references into charCodes in ActionScript? For example, has a decimal or numeric entity reference of a. I assume that the charCode would be 8736 since I've found that charCodes of lower decimal values match.

View 1 Replies

ActionScript 2.0 :: Display Number To 2 Decimal Places?

Sep 13, 2008

I am totally confused about this one. I am trying to display a number as x.xx, but I'm having problems! The number has 0, 1 or 2 decimal places, so I have an if else to add '0' or '.00' on the end if there are 1 or 0 decimal places respectively.[code]...

View 3 Replies

ActionScript 2.0 :: Count Number Of Decimal Places?

Feb 13, 2012

why does this not work for counting the number of decimals?

Code:
var num:Number = 4.321;
counter=0
while (num%1!=0) {

[Code]....

View 0 Replies

ActionScript 2.0 :: Rounding Number To 2 Decimal Point?

Jan 12, 2004

what actionscript do i need to round off a number to 2 decimal points? i have this script which brings me the number but consisting of 8 digits!

digital = _root.val[0].substr(0,_root.val[0].indexOf("<br>"));
digital = Math.abs(digital);
trace(digital);

[Code].....

View 1 Replies

ActionScript 2.0 :: Show Two Decimal Places Regardless Of The Number Itself?

Sep 12, 2004

how I can format numbers in Flash so that it will show two decimal places regardless of the number itself?

View 4 Replies

ActionScript 2.0 :: Rounding A Number Down To Two Decimal Places?

Aug 30, 2005

I'm trying to calculate loan payments using actionscript.

i'd like to have my variable's value like this:

843.34

instead of:

843.3454 (how it's displaying now)

since I'm ultimately going to display $dollar amounts.

I know how to use Math.round() but I'd like to go to two decimal places!

View 1 Replies

ActionScript 2.0 :: Making A Number Always Have 2 Decimal Places?

Jan 3, 2004

What is the Math.???? for making a number always have 2 decimal places?

View 5 Replies

ActionScript 2.0 :: Convert A Flash Binary-decimal Converter To Another Programming Language

Nov 28, 2005

Im trying to convert a flash binary-decimal converter to another programming language (TI-Basic). I've got all of it down except one key part. I've got a solid backing of actionscript understanding but find myself unable to understand the following statement:

if (iNumber%2) { bin = "1"+bin; }
from this tutorial

I realize that inumber%2 will return a value being the remainder of inumber divided by 2, but how can this be a conditional? "if (2) { }" doesn't work for conditonals im used to. Or if your a TI-Basic wiz

p.s. how do you wrap actionscript tags around content in a post on the forum?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved