Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Flash General Questions > Other Flash General Questions

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-12-2001, 07:22 PM   #1
xperimental
Registered User
 
Join Date: Feb 2001
Location: 23rd demension
Posts: 14
Send a message via ICQ to xperimental
Exclamation

I have a calculator I am building in flash and want to format the input boxes to the following format:

user input: 2300000
return: 23,000.00 ---> I wnat all fields to follow this formating rule regardless of what they enter.

So

two intergers from the right insert decimal, and for every three intergers from the decimal insert a comma.

It is a calculator and it needs to be able to perform mathamatical equations.

thanks.

Xperimental.
xperimental is offline   Reply With Quote
Old 02-13-2001, 12:50 AM   #2
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

That would mean you'd have to actually calculate based on other varaibles. If the user enters 123450 and you format it to 1,234.50 you're not going to be able to us that variable in a mathermatical equation any more coz it has non-numerical characters in it.

But if you still want to do it you can use length() and substring. As a matter of fact, if you checkout Flashguru's Function Library int he tutorials section you could use that. Convert the data to an array, then use his reverse array. Then insert values from left to right (which will be easier using substring() ) then reverse the array again....

It's not going to be too dificult, so you try scripting it first. If you can't, I'll help out.

Cheers

Jesse
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Old 02-13-2001, 01:45 AM   #3
xperimental
Registered User
 
Join Date: Feb 2001
Location: 23rd demension
Posts: 14
Send a message via ICQ to xperimental
Default Thanxs

Thanks for the reply,

The hardest part is the ",". And as of this second I've gotten kinda lost with what you said. But I'll do some digging.
My script so far is working fine, a lot of variables are being passed around, and the "." works alright with an equation, it's just the blessed "," that messes it up.
We'll see how it goes,and when it's done I'll let you know how it turned out.

Thanxs.
xperimental is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
text field height? circa1977 Other Flash General Questions 6 03-29-2007 11:07 PM
calling a PDF file in Flash AudryLucy Projectors and CDs 20 12-30-2006 02:43 PM
dynamic text field in button suzu ActionScript 2.0 4 02-12-2006 09:56 PM
Changing dynamic text field from _root? wmbenedetto ActionScript 2.0 2 01-24-2006 02:34 AM
dynamic text field is calling the variable name instead of variable content thomPhelps Other Flash General Questions 6 03-11-2004 11:02 AM


All times are GMT. The time now is 12:43 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.