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

Capping math calculation at zero?

Guest
Sep 10, 2013 Sep 10, 2013

Hi guys

How do you cap a maths calc so that if it's capped at zero if the result was going to be negative? Is there a func?

Cheers

TOPICS
ActionScript
727
Translate
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

correct answers 1 Correct answer

Community Expert , Sep 10, 2013 Sep 10, 2013

:

yourcalculatedvalue = Math.max(0,yourcalculatedvalue)

Translate
Community Expert ,
Sep 10, 2013 Sep 10, 2013

:

yourcalculatedvalue = Math.max(0,yourcalculatedvalue)

Translate
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
Guest
Sep 11, 2013 Sep 11, 2013

Thanks kglad - I'll slot that in today.

Translate
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 ,
Sep 11, 2013 Sep 11, 2013
LATEST

you're welcome.

Translate
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