Timer and problems (decimal) numbers
HelloWhat should seem fairly simple seems completely ruin.
I create a timer that takes place every 10th of a second, that I need this amount of precision.
The code I have is:
var titleTimer:Timer = new Timer (100);
Start the timer for flicking splash
titleTimer.start ();
titleTimer.addEventListener (TimerEvent.TIMER, flicker);
parts twinkle function
flicker of function (event: TimerEvent): void
{
titleCounter += event.target.delay / 1000;
trace (titleCounter);
}
The result I get is something like this:
0.1
0.2
0.30000000000000004
0.4
0.5
0.6
0.7
0.7999999999999999
0.8999999999999999
0.9999999999999999
1.0999999999999999
1.2
1.3
1.4000000000000001
1.5000000000000002
1.6000000000000003
1.7000000000000004
1.8000000000000005
1.9000000000000006
2.0000000000000004
2.1000000000000005
2.2000000000000006
2.3000000000000007
2.400000000000001
2.500000000000001
2.600000000000001
2.700000000000001
2.800000000000001
2.9000000000000012
3.0000000000000013
3.1000000000000014
3.2000000000000015
3.3000000000000016
3.4000000000000017
3.5000000000000018
3.600000000000002
3.700000000000002
3.800000000000002
3.900000000000002
4.000000000000002
4.100000000000001
4.200000000000001
4.300000000000001
4.4
4.5
When I want to:
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
1.1
1.2
1.3
1.4
etc. etc...
Not 1 million decimal after.
Anyone know how to fix this?
Thanks in advance for any help!
Lee
then use:
Tags: Adobe Animate
Similar Questions
-
Regex to allow only integer and decimal numbers.
Hi all
I need a regex to allow only integers and decimal numbers.
Examples:
100 licences
100.00 - Unauthorized
100 - unauthorized
100.11.22 - unauthorized
all characters other than numbers - unauthorized
I used the regular expression - ^ [0-9] +. ? [0-9] * $- but its allowing the "100" also.
Can someone help me solve this problem.
Your timely assistance is greatly appreciated.
Thanks in advance.
Hello
inDiscover wrote:
Hi all
I need a regex to allow only integers and decimal numbers.
Examples:
100 licences
100.00 - Unauthorized
100 - unauthorized
100.11.22 - unauthorized
all characters other than numbers - unauthorized
I used the regular expression - ^ [0-9] +. ? [0-9] * $- but its allowing the "100" also.
Can someone help me solve this problem.
Your timely assistance is greatly appreciated.
Thanks in advance.
Use
^[0-9]+(\.[ 0-9] +) ? $
to make the decimal point and the following figures (of which there must be at least 1), as a unit, as an option.
-
Calculation of tabular form, problem with decimal numbers
Hello
I wrote a simple java script function that is responsible for calculating the price * quantity and store that value to total_price.
function CalcTotalPrice (pThis)
{
var vRow = pThis.id.substr (pThis.id.indexOf ('_') + 1);
html_GetElement ('f07_' + vRow). Value = parseInt (html_GetElement('f06_'+vRow).value, 10) * parseInt (html_GetElement('f05_'+vRow).value, 10);
}
The function calculation is correct, but I have problem when the price or quantity decimal numbers.
For example.
Currently:
price * quantity = total_price
7.5 * 1 = 7 instead of * cf. 7.5 *.
I've already put a mask of correct format for all of these areas (999G999G999G999G990D00).
I appreciate your help.
Request Express 4.2.1.00.08
Oracle Database 11g Express Edition Release 11.2.0.2.0
Kind regardsHi John,.
before the multiplication, you analyze your values as an integer, so 'cut' the decimals.
Replace "parseInt" by "parseFloat" should do the trick.function CalcTotalPrice(pThis) { var vRow = pThis.id.substr(pThis.id.indexOf('_')+1); html_GetElement('f07_'+vRow).value = parseFloat(html_GetElement('f06_'+vRow).value, 10) * parseFloat(html_GetElement('f05_'+vRow).value, 10); }
Please let me know if this worked for you.
Thank you
Sandro -
Is anyone having problems with the Times and the Sunday Times App
Im having problems loading from the Times and the Sunday Times app. Before I launch into a major description (I have Parkinson's disease, and typing is slow) is there a known issue with the application at the present time
There has been a lot of problems with this app as soon as they have a clear, the other seems to appear. Take a look at this link and it followed in areas where you are affected by.
http://www.thesundaytimes.co.UK/Sto/multimedia/archive/00258/Helpguide_stripped _ _258975a.pdf
-
The 'update date and time"for numbers of 3.6 does not show the time and does not automatically update the date. What should I do? Thank you.
Hi david,
where do you find ' update of the date and time.
Quinn
-
by the numbers, how can I convert a start time and end in hours time
I convert my files to Excel, and no to not translate my formulas.
I have a start time, end time, and hours, what formula should I use to have hours to calculate?
Thanks for any help
by the numbers, you can perform mathematical operations on time like this... assuming they are valid values for date/time...
Assuming that one time is in cell A1 and the other is in A2, you can get the difference like this:
= dur2hours(a1-a2)
-
I have a windows server R2 2012 which automatically switches out of his own for several times and it doesn't look like a hardware problem. and I have this problem every day.please tell me what is the reason
Original title: r2 windows server 2012
This issue is beyond the scope of this site and must be placed on Technet or MSDN
-
Hello
After installing something from windows update (about 300 MB in size) my computer start Startup Repair each time and said "a hard disk problem is preventing Windows from start" and turns off.
Then a window pops up saying "Startup Repair cannot repair this computer automatically.
The details of the problem say;
Problem event name: StartupRepairV2
Signature of the problem 01: AutoFailover
Signature of the problem 02: 6.0.6001.18000.6.0.6001.18000
Signature of the 04:65537 problem
Signature of the problem 05: unknown
Signature of the 06 problem: BadDisk
Signature of the 09 problem: unknown
Signature of the 10:1168 problemSystem Restore does nothing, and all the other tools of recovery. :(
Please help, it will be much apreciated :)
DOMIf you are sure that the problems began immediately after installing a Windows Update, use the free support of MS here:
Visit the Microsoft Solution Center and antivirus security for resources and tools to keep your PC safe and healthy. If you have problems with the installation of the update itself, visit the Microsoft Update Support for resources and tools to keep your PC updated with the latest updates. MS - MVP - Elephant Boy computers - don't panic! -
Problem with timer and Reset. Help please :(
Hello everyone, I have a big problem when I put a button to reset my program. In addition, from the time of my game.
I am doing a project named "Simonsays" which consists of a sequence of colors that you need to remember and must click on each color to pass the level.
The problem is that I do a clock or a counter to count the time of a game. For example when I press "start" the beginning of time, and when I make a mistake in the game time must stop. There is another button named "New Game" or "Nuevo Juego" which is used to 'RESET' of the game, but I can't this is the button used to RESET.
The game starts when you press "COMENZAR" and labview window disappears, then you will need to click on "START" and the game begins... BUT when you make a mistake, the game must be stopped with the TIME that you make throughout the game, and the game must wait until you press "NEW GAME" and newly him game begins with a new counter of the time.
I hope you can help me. Please, I beg you.
There are 3 files, because the files are connected.
Thank you.
I think I've answered before?
-
USB modem stop working after long time and I have to unplug then plug it in again, I want to solve this problem without unplugging and plug?
Hi ahmedman_10,
· You follow the steps in the article of my previous answer?
Follow these steps in my previous answer and at the same time this article, follow these methods.
Method 1: Follow the steps in the article.
USB port may stop working after you remove or insert a USB device
Method 2: Update the latest drivers for chipset.
How to manage devices in Windows XP
For reference:
Why my computer does not detect my new USB device when I run Windows XP or Windows Server 2003?
-
Problems with updates important installation time and time again
the following have not installed successfully on my laptop: Windows Vista 32 bit
STARTING ON 10/14/2010 FOLLOWING DO NOT HAVE
KB2206011
KB2281679
KB979688
KB981957
KB2387149
KB2360131
KB982132
KB979687
KB2207566
KB2345886
KB2378111
KB2416400
STARTING FROM 15/12/2010 THE FOLLOWING DO NOT HAVE
KB2296199
KB2442962
KB2305420
KB2436673
KB2423089
THE FOLLOWING HAVE INSTALLED SUCCESSFULLY 26 TIMES AND CONTINUE TO RE-INSTALL AND IT IS THAT PROMPTED THE INITIAL QUESTION, NOT KNOWING THE OTHER HAD FAILED UNTIL I WAS ASKED TO REVIEW THE HISTORY AND SEE WHAT A FAILED I DON'T SEE NO ERROR CODES
KO 2518870
KB2478663
WHAT'S WRONG WITH THIS POINT?
KB2296199
Hi, Rose MarySteele,.
Run the FixIt to is this document to resolve the problem with the same update offered repeatedly.
Let us know if this helps
-
I use OS Windows7, drivers intel blocks most of the time, and whenever I try to solve this question message says: the solution to this problem can not be downloaded. What should I do?
Original title: problem with drivers
Hi Pragati,
1. What is the accurate and complete error message you get?
2. when exactly you get this error message?
3. don't you make changes to the computer before the show?
4. What is the brand and model of the computer?This problem can occur if the drivers for this particular material is not updated.
Method 1: I suggest you run the hardware and devices Troubleshooter and see if that helps.
Open the hardware and devices Troubleshooter
http://Windows.Microsoft.com/en-in/Windows7/open-the-hardware-and-devices-Troubleshooter
Method 2: I suggest you to update the drivers for the Intel hardware by selecting the model number from the following link:
https://Downloadcenter.Intel.com/default.aspx
Come back and let us know the State of the question, I'll be happy to help you. We, at tender Microsoft to excellence.
-
I upgraded to Win7x64 and now I have my Lexmark 2470 printing problems. I reloaded the software several times and still cannot print. Any suggestions?
Hey! Try this link
-
I use windows 7 and inter explorer9. whenever I run any video on youtube. It always freeze for a short time and you run. I have to fast forward or rewind the video to run without problem. could someone help me in this matter. all my programs are up to date.
Earlier this week Adobe had a version update available / grew Reader,.
Troubleshooting video, scroll sections Java and Silverlight and use your links version control, uncheck the installation of Java Ask Toolbar addon.
http://support.Microsoft.com/kb/2532294
Trouble Shooting games, Shockwave player related.
http://support.Microsoft.com/kb/2528246
Uninstall flash if necessary,
http://kb2.Adobe.com/CPS/141/tn_14157.html
Download the Flash and Shockwave players and player while your there with ads at the top right of this links page, uncheck the installation of Adobe Chrome addon.
-
Hi, I bought acrobat adobe pro ms with order number: 12287735659 but I have not received the download link and the serial numbers of adobe and had this message there is a problem processing your order, please contact our Service team customer to 800 448 1642 for assistance. my credit card is already loaded, but not received numbers.please series suggest
Hi Kunal,
If the problem still persists, can you please contact the support for this issue through https://helpx.adobe.com/support.html#/top_products.
Please do not hesitate to me message in person if assistance is needed.
Concerning
Stéphane
Maybe you are looking for
-
What I do on the software malicious macerror.xyz?
I have to delete Firefox and reinstall?
-
My i pad has entered a mode and Scott so he could be activated, no idea why, I get my apple ID and password, he told me his hurt, when I know that it is correct, no matter who else has had this problem?
-
Facebook application for Toshiba Journ.E touch
Hi guys (1) my Toshiba - DAY tablet. E TOUCH doesn't have the application for facebook of begging, when I bought it.I try to find the virtual store and I have noy could find it.Can you please help me where I can find this application? (2) what video
-
How can we change the warm tone of the retina face before Flash in a colder tone?
I'm Asian, and everybody knows we have a yellow complexion. Whenever I take a picture using the front cam, I find myself always looking like a pumpkin due to the warm tone of the lightning. If there is a setting that can change the tone of the lightn
-
Changed the hard drive from laptop - now Vista not genuine
My Toshiba laptop packed. I removed the hard drive and put it in a similar laptop. It worked very well. Now, I have returned this phone to its owner and reinstalled my original hard drive of my laptop. He is currently working (?), but get the Vista c