problem of adding - actionscript/flash is able to calculate correctly?


Hello
I add two float numbers that return an incorrect result. Here's what I do...

var simpleMath:Number is Number (parseFloat("110.50")) - Number (parseFloat("107.10")).;
Alert ("mathematics simple =" + String (simpleMath));

The result I get is... Simple calculations = 3.40000000000001

How is that possible?
I tried...
var simpleMath:Number = Number (110.50) - Number (107.10);

var simpleMath:Number = 110, 50 - 07.10;

var numba:Number = 110.50;
var numbb:Number = 107.10.
var simpleMath:Number = numba - numbb;

They all give the same result...

When I try this:
Final_Payment.text = Number (Total_Payment_Due.text) - ((Number (Payment_Count.text)-1) * Number (Payment_Amount.text));
Where Total_Payment_Due.text = 110.50 and 36 = Payment_Count.text and Payment_Amount.text = 3.06
I get this result: 3.39999999999999...

Is someone can you please tell me what I'm wrong. Or is there a problem with actionscript/flash...

I use actionscript within a savecontent Flash and Cold Fusion 7.0.1 form variable.

It drives me crazy...

Also, is there a function rounded for floats? I know the Math.round () but it only works on integers.

Any help would be appreciated to extreemly!
Thanks in advance,
Ed

"ed_skinner" wrote in message news:[email protected]...
>
> Hi,.
> I add two float numbers that return an incorrect result. Here's
> what I do...
>
> var simpleMath:Number = Number (parseFloat ("110.50")).
> Number (parseFloat ("107.10"));
> alert ("mathematics simple =" + String (simpleMath));
>
> The result I get is... Simple calculations = 3.40000000000001
>
> How is this possible?

It's the same old problem we always had with floating stored in the memory of the computer... Flash not only. To deal with
dollars and cents, you can make it easy on yourself by multiplying both sides by 100 and rounded to eliminate decimals, can
final calculation divide by 100.
You can also multiply/divide by 1000 if you need greater precision in the slot.
tralfaz

Tags: Adobe Animate

Similar Questions

  • Problem with FLVPlayer in Flash CS3 (you need to register on Actionscript 3.0 SWf file)

    I use Flash CS3 and I'm trying to publish a SWF file that makes use of the "FLVPlayback" component I need this SWF file that will be published in an Actionscript 3.0 file, I then put my publication of Flash Player 9.0 and Actionscript 3.0 settings, but get an error as follows:

    "WARNING: the"FLVPlayback"component requires ActionScript 2.0."

    If someone has encountered this? I'm doing something wrong? I'm quite comfortable in Actionscript/Flash 2.0, but I'm only my first not in the relam CS3 and AS3.

    I've also attached a screenshot of the files which represent my FLVPlayback component (or so I assume). (see this link for attachments http://www.actionscript.org/forums/showthread.php3?t=140886)

    Thank you all,
    Mark



    http://www.ActionScript.org/forums/showthread.php3?t=140886

    Mark,

    > I put my settings of publication of Actionscript and Flash Player 9.0
    > 3.0, but keep getting an error as follows:
    >
    > "WARNING: the"FLVPlayback"component requires ActionScript 2.0."

    Gotcha. You have started the document in AS2, and then changed the
    publication settings. Each language version has its own version of the
    (Written in the language concerned) FLVPlayback component. Start over and
    compare two compleley new FLA documents: make one for AS3 and AS2.
    Open the components Panel and note the differences between the two. He
    are a different set of components according to the language chosen for the
    document. Drag the FLVPlayback components Panel in a
    AS3 document and you have the AS3 version.

    David Stiller
    Co-author, Foundation Flash CS3 for designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • I have a problem. Update of Flash Player required you must download and install the latest version of Adobe Flash Player to view this content. but my Flash player is up-to-date. I use ubuntu10.4, firefox 8.0

    I have a problem. Update of Flash Player required you must download and install the latest version of Adobe Flash Player to view this content. but my Flash player is up-to-date. I use ubuntu10.4, firefox 8.0

    You are welcome

  • Problems to install a Flash player update.

    Original title: problems installing to a flash document that got reulst to other people who use this type of product

    I REALLY think that I have not updated to the latest version which is on the good drive flash update. Also, what type of update of flash player I need, as well as the best and free way to take pictures of a video?

    Sincerely,
    Natalie LaBarr
    E-mail address is removed from the privacy *.

    Hi Nathalie,.

    1. What is the exact problem you are facing with Flash player? Are you unable to update Flash player?

    2 are. what video you referring?

    If you try to update the latest version of Flash player, you can refer to the Adobe Web site and check if that helps.

    Adobe Flash Player 11.7.700.202

    For more information, see Adobe support article:

    Adobe Flash Player 11 / techniques

    If you have problems to install Flash Player, you can consult the Adobe support article and check if it helps.

    Flash Player / installation issues

    You can also get in touch with the assistance of Adobe to check for what type of update flash player you need and for further assistance.

    Hope the helps of information.

    Let us know if you need help with Windows related issues. We will be happy to help you.

  • Problem with adding new storage to the CDV provider profile

    Hi all

    I have problem with adding new storage to the CDV provider profile.

    My ENV:

    VCD Version 5.5 latest

    vCenter 5.5

    VCDDB - SQL

    I created the environment with two profiles of storage for the first time and it's work well (the storage profile created before I joined the vCenter on the VCD)

    I created tags and he attributed to the data store and I see the new VM storage through the vSphere web client policy.

    I can also see VMS on the VCDDB the dbo.storage_profile_inv the new storage policy table and when I create new provider TDC I can't.

    What I'm trying:

    1 Refresh the storage via the VCD (right click on the attached vCenter) profile

    2. restart the inventory and the profile based on the vCenter servers

    3. restart the VCD and vCenter servers

    Help, please

    You can just follow KB 2075366.

  • In fact, I have problem in adding music to be played across all folios, the problem happened when I simply lock the ipad and open it, the publication is always open and I can browse, but the music stops and cann't continue. How can I solve this t

    In fact, I have problem in adding music to be played across all folios, the problem happened when I simply lock the ipad and open it, the publication is always open and I can browse, but the music stops and cann't continue. How can I solve this problem to continue after the opening of the ipad and continue to navigate the digital publication.

    The background sound plays only if the application is open. Once the device is locked or the user switches to another application the audio will stop.

  • I'm having a problem to install the flash player on my Win 7 PC

    Same question as many other peple.  IE just won't work downloads and installs well but does not work

    I'm having a problem to install the flash player on my Win 7 PC

    Hello

    Have you followed the steps in troubleshooting posted here, Activate for Internet Explorer?

    --

    Maria

  • Unusual problem caused by/with flash?

    An unusual problem has recently developed Flash and cannot be resolved. I am running windows XP service pack 3 and I have flash 10.1 running. The problem I ran into is - that, when the browser is open and let it idle for 5 minutes, only a windows error message appears that says:

    Did not find file "Flash.ocx".

    Before the 08/10/2010 this never happened, more I looked into the files on my system, and the program seem to be there. I also checked the program with Adobe and here the so-called program is up-to-date and working properly on both internet browsers that I have that are: IE8 and Google Chrome. If someone can help identify this problem because I'm not sure of what are the measures taken to address this problem and Microsoft has become completely useless.

    Hi, you could be something. Take a look at this old thread, begin to Post #10. There is discussion on the screensavers and Flash Player.

    http://forums.Adobe.com/thread/4997?TSTART=0

    eidnolb

  • I can't move the icons on my desktop by dragging them (I use to be able to) how correct them where I can move them again (I can't delete is)?

    I can't move the icons on my desktop by dragging them (I use to be able to) how correct them where I can move them again (I can't delete them either?)

    Hello

    Thanks for posting this question in the Microsoft Community.

    If I understand correctly, you are not able to drag icons on the desktop. I'll certainly try and help you in the matter of fixing.

    To help you to propose measures to solve the problem, I would appreciate if you could answer the following questions:

    1. Since when are you facing the issue?

    2. you have any security program installed on the computer?

    3. what happens when you try to remove the icons?

    4. do you get an error message?

    5. are you aware of any changes made to the computer before the show?

    Run a full scan using the Microsoft Safety Scanner and check for infections.

    Note: there is a risk of data loss if all the files are infected and which can be removed in the cleaning process.

    If the problem persists, start the computer in safe mode and perform a clean boot. Clean boot helps eliminate software conflicts.

    Note: when you are finished troubleshooting, follow step 3, mentioned in the article to start the computer to a normal startup.

    Hope this helps and let us know if you need more assistance. We will be happy to help.

  • Not able to install updates to get the message: 'updates were not able to configure correctly, returning from changes'...

    Original title: I have Vista with Service Pack 2, but were unable to come down and configure updates since 07/12/11. Need help, thank you.

    Do not get the error codes. Just when I reboot, I get the message "updates were not able to configure correctly, returning from the changes".

    Hello

     
    You are able to start in safe mode, then you can perform the clean boot in safe mode and then try to boot into normal mode.
    Put your boot system helps determine if third-party applications or startup items are causing the problem.
     
    See the following article in the Microsoft KB for more information on how to solve a problem by performing a clean boot in Windows Vista or Windows 7:
    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135
    Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 7 in the above article.
    If you are able to boot to the desktop after you perform a clean boot Windows check updates history of inforamtion on the updates failed.
    Reference:
     
     
     
     
  • Some icons in my computer, in Windows Explorer on the desktop, or on the Quick Launch bar change randomly. This problem occurs if the icon cache is not updated correctly. How can I rebuild the icon cache solves this problem

    Some icons in my computer, in Windows Explorer on the desktop, or on the Quick Launch bar change randomly. This problem occurs if the icon cache is not updated correctly. How can I rebuild the icon cache solves this problem

    http://www.Vistax64.com/tutorials/117229-icon-cache-rebuild.html

    How do I rebuild the icon Cache in Vista

    See you soon.

    Mick Murphy - Microsoft partner

  • I just wanted to know at all, if you encounter a problem with the update of creative cloud as if I was (error 1001), I discovered that my Webroot AntiVirus has been the origin of the problem. I turned it off and it updated correctly. Hope that helps some

    I just wanted to know at all, if you encounter a problem with the update of creative cloud as if I was (error 1001), I discovered that my Webroot AntiVirus has been the origin of the problem. I turned it off and it updated correctly. Hope that helps some people I've seen so angry about it here by searching for the answer myself.

    Thanks for sharing this, yes turning Firewall works.

    Concerning

    Stéphane

  • I have problems to download Adobe Flash 18, anyone who has a problem?

    I have a problem downloading Adobe Flash 18. I get a little window that says "Installation will begin shortly." About 5 minutes later, I get an error message that says: "Error initializing Application." And when I click on the button finish down to the right, it takes me just back to Adobe to download again. Does anyone have a problem with that?

    Dude, you're a few days too late. It's working now. It's Norton who was originally the majority of headaches including not to be able to get on the internet after my Adobe Flash 18 work. Now I have a problem and it is an add on I installed. AdBlock more. This add-on on Firefox crashing on Facebook sites and Publisher Clearing House, mainly because these two sites are littered ads is originally.

  • HP Pavilion 500-314: big problems by adding an external video card

    You are looking for assistance.

    I recently bought a HP Pavilion 500-314.  Specifications are the following:

    http://support.HP.com/us-en/document/c04293928

    The unit includes the integrated graphics card Radeon R7 and comes with a 300w power supply

    I bought this unit in large part because it states explicitly that "supports PCI Express x 16 graphics cards".  I run a quad-monitor configuration for my work and traditionally did it this using a card ATI over-pants 2450.

    I tried now three different external graphics cards and can get any of them to work:

    First attempt was with a VisionTec Radeon HD 5570 (point #900345).  This card supports quad-monitor configuration and requires a minimum power of 250w.  When I installed the card, the HP Pavilion beeps several times a series of 4 or 5 (can't remember which) emits a beep, but refused to send an image to a video output (either on board or the new card).

    Next attempt was with an EVGA GeForce GT 610.  It's a Setup dual monitor and requires a minimum 300w power supply.  Got the same exact response as with the VisionTec (i.e. the series of beeps... computer would not start all monitors).

    So both of these cards (new), I basically gave up immediately that I couldn't in the BIOS (b/c wouldn't monitors) to see what was going on.  My understanding is that the series of 4-5 beeps usually means that there is a problem of graphics card, or the card that was added doesn't have enough power.  It's frustrating, because the HP Pavilion 500-314 a supposedly a 300w power supply, which is at least equal to the minimum required for each of these cards.

    At this point, I took out the ATI over-pants 2450 my old machine and tried.  This card at least has not caused the series of 4-5 beeps.  Windows has started.  However, once I log in, Windows tries to install the new (card over-pants) repeatedly, only then, the screen flashes and blinks and flashes.  Then I went into the BIOS.  The BIOS indicates that the system recognizes the card, and that the integrated video has been disabled.  However, there is always a signal coming out of the onboard video output (DVI), so it is not in fact actually disabled.  My feeling is that Windows is trying to control two separate video cards (edge + external), which is what causes the problems.  I can turn off the graphics card over-pants w/under Windows (in Safe Mode) and let the card installed, and things work fine.  However, as soon as I try and activate the card, I get endless cycle flashing monitors.

    I spent a few long sessions with HP technical support and they were useless.  They claim that this is not a problem of HP as the embedded video works fine.  I find this extremely frustrating response.  I think it is a matter of HP, because BIOS doesn't seem to be properly disable the onboard video.  Not to mention that the PC can't seem to properly interface with Windows compatible 8 PCI-E cards that claim explicitly require less energy than this unit has.

    I'm usually pretty computer savvy, but have reached my wits end on this one.  I'd appreciate any help anyone could provide.  I tried all kinds of combinations of variables (i.e. enabling integrated video, setting external card at the elementary level, etc.) through the BIOS, but also combinations of w/under Windows, disable integrated video, but nothing is working.

    900345 VisionTek Radeon HD 5570 1 GB DDR3 PCI Express 2.0 x 16

    Big_Dave,

    Thanks a lot for your quick response.

    The first time that I spoke with HP support, they had me disable secure boot.  Unfortunately my problems (i.e. the cards would not install correctly).  However, after reading the link you provided that I was inspired to try things one last time with a new beginning.  I uninstalled all drivers, removed all cards, re-engaged start-up secured, restarted, close, disabled secure boot, reinstalled the cards and rebooted.  And, this time, the system accepts the card GeForce GT 610.

    Difficult for me to express how grateful I am to you.  I spent two weeks and countless hours trying to get this corrected.  Just I found these forums earlier wish.

    WallMonkey02

  • The problems IAM downloaded adobe flash player and get the videos to play

    videos YouTube will not play it says I need to download adobe flash player. I took the old flash player and download a new but still not able to watch movies. It seems that the flash player is in the computer but will not work. I have a laptop windows 7 hp Pavilion g series

    Hello

    Try to run through the Daniel_Potyrala guide on the following link.

    http://h30434.www3.HP.com/T5/notebook-display-and-video/the-solution-to-most-problems-with-the-Flash-Player-plugin/TD-p/1399719

    Kind regards

    DP - K

Maybe you are looking for

  • Favourite Add - ons disappear between sessions

    When I start my computer lately, about three of my favorite FF (ver. 33.1.1) modules are installed is no longer. It's Lazarus, X-notify and theme and size Changer.I fonts can reinstall them manually, but it becomes a pain to do. I find that when I re

  • DSC-Modbus IO Server

    My application processes reading registers a target of Modbus RTU (serial) then for the same iv set up a Modbus IO server which is available at DSC8.6. Lettering communicates well in the meantime real target & LabVIEW PC development but doesnot work

  • Code error 0xc004e003, and Vista Home Edition Premium is not allowed.

    Original title: my windows vista family premium is now show a message that it is not allowed, after 4 years of functioning. I also have an OxCOO4E003 code. Can you advise what happened? The software is legal, he came with the ACER PC at the time of p

  • I try turbo tax and get code error 2350

    I have tried to install turbo tax 2010 and seemingly impossible because that used to install the update for microsoft.net 3.5.  Does anyone else have this problem?  I get the error code 2350.

  • Bluetooth not looking for any device

    Hello Sir, I haven't bought the HP 15 d103tx in a store as value by default, there is no operating system so I installed windows 7 SP1 64-bit windows, all the drivers are up to date but now I am unable to use bluetooth as it is not looking for any de