Skip to main content
August 18, 2011
Answered

Comapre numbers with decimal

  • August 18, 2011
  • 1 reply
  • 566 views

Hi,

I am using CP 5 advanced actions - conditional actions, trying to show the less number in the caption. However, seems CP assumes that a number with decimal is less than the number itself. For example, we have 5875.198.148 and 5875, then 5875.198.148 will be taken as the less number.

Best,

Ya

This topic has been closed for replies.
Correct answer Lilybiri

Hello,

I just checked this and for me the condition is evaluated correctly. Could you post perhaps a screenshot of your advanced action? This was my work flow:

  • created two user variables, one with a decimal value, the other with the same value but only the integer
  • had two rectangles, initially invisible, one for correct result, one for incorrect
  • on entering the slide I triggered a condition to compare the variables and show the appropriate rectangle; all worked fine

Just a tip: try if it works if you put the values themselves in the condition, like  IF   15.5 is greater than 15 

BTW: you seem to have two decimal points? That will not work, I suspect this will not be treated as a value because it isn't a value

Lilybiri

1 reply

Lilybiri
LilybiriCorrect answer
Legend
August 18, 2011

Hello,

I just checked this and for me the condition is evaluated correctly. Could you post perhaps a screenshot of your advanced action? This was my work flow:

  • created two user variables, one with a decimal value, the other with the same value but only the integer
  • had two rectangles, initially invisible, one for correct result, one for incorrect
  • on entering the slide I triggered a condition to compare the variables and show the appropriate rectangle; all worked fine

Just a tip: try if it works if you put the values themselves in the condition, like  IF   15.5 is greater than 15 

BTW: you seem to have two decimal points? That will not work, I suspect this will not be treated as a value because it isn't a value

Lilybiri

August 19, 2011

Thank you!

I just want to try my luck that 5875.198.148 could be treated a number greater than 5875. Seems I need to find some other ways to compare them. It's fine, not a big deal.

Thanks again.

Lilybiri
Legend
August 19, 2011

Hello,

To be recognized as a number it must really be a number and as a maths lover I never did see a number with two decimal points. So I suppose that Captivate will recognize this as a string, where the greater then operator has no real sense.

Lilybiri