• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Multiplication 2 numbers is behaving strange

Contributor ,
Feb 15, 2023 Feb 15, 2023

Copy link to clipboard

Copied

Hi everybody!

This is either going to be "oh duh" or "oh god"... I just came back from a holiday. 🙂

While multiplying numbers, I'm sometimes getting "close" but wrong results.

 

Does anybody have experience with that?

jefbr_3-1676472828328.png

 

See how 190*2.379 should be 452.01 and not 454.389?

 

This is the cleaned up code (I changed the numbers for readability) 

var theThing = {    x:100,
                    y:200,
                    w:300,
                    h:400,
                    gravity:{   x:100,
                                y:200
                            }
                };

var ratio = 2.379;

theThing.x *= ratio;
theThing.y *= ratio;
theThing.w *= ratio;
theThing.h *= ratio;
theThing.gravity.x *= ratio;
theThing.gravity.y *= ratio;

 

The data types are "number" not string (checked it)

 

Does anybody have any suggestion/lead/tip/link/pill?

 

Thanks a lot! ❤️

 

 

 

TOPICS
Actions and scripting , Windows

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Contributor ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

Hello? Is there anybody out there?

Just nod if you can hear me...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

They're probably all just comfortably numb 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

Goddammit! 😄

 

Your lips move but I can't hear what you're saying!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

I'll need some information first
Just the basic facts

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

alert (Number(190*2.379))

poduces 

Screenshot 2023-02-16 at 12.48.02.png

for me. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 02, 2023 Mar 02, 2023

Copy link to clipboard

Copied

LATEST

More for myself than anything else...

That image, and only that image, has a different size than all others in the collection I'm using for testing.

 

Key takeaway:

Before you throw an adobe at the wall, check your media as well as your script!

 

FML.

❤️

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines