# [Closed] Can I do a math equation inside of a conditional

Tagged:

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 4 years, 5 months ago.

Assigned support staff: Minesh.

Author
Posts
#338795

I am trying to do some simple math inside a conditional.

`[wpv-conditional if="( \$(wpcf-shape-score-a) - \$(wpcf-final-score) lte '6' )" debug="true"] yellow[/wpv-conditional]`

Is this possible?

DeBug code:
<div class="shape game bold <pre>####################
wpv-conditional attributes
####################
Array
(
[if] => ( \$(wpcf-shape-score-a) - \$(wpcf-final-score) <= '6' )
[debug] => true
)

####################
Debug information
####################
--------------------
Original expression: ( \$(wpcf-shape-score-a) - \$(wpcf-final-score) <= '6' )
--------------------
After matching 1 numeric strings into real numbers: ( \$(wpcf-shape-score-a) - \$(wpcf-final-score) <= 6 )
Matched '6' to 6
--------------------
Converted expression: ( '20.00' - '14' <= 6 )
--------------------</pre>">
Miami
</div>

#338860

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Yes, I think it should work as in our documentation its listed that we can use: Math operators: +, -, *, /
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
[ Please go through the section "Syntax"]

The topic ‘[Closed] Can I do a math equation inside of a conditional’ is closed to new replies.