You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to do some basic arithmetic, using things like <current() * 10>, but I only get 0 as result. Actually 0 is what's saved in the database so that might return null. So how is it possible to do basic arithmetic Operations in the Fixtures?
The text was updated successfully, but these errors were encountered:
<something()> is the notation for calling the function something, so <current() * 10> will not work and should even throw an error IMO. I am not sure why this is not the case in 2.x but it will throw an error for sure in 3.x.
To achieve what you want to do, you need to have a custom function to do the operations. It is a bit inconvenient and might be something to enhance in the future.
Update on the issue, this is easily doable by using the identity function: <(10 * 5)>. The only limitations are that the identity function only knows about references and variables: <(@user->favoriteNumber * $current)> (the <current()> is accessible via the $current variable).
I'm trying to do some basic arithmetic, using things like
<current() * 10>
, but I only get0
as result. Actually0
is what's saved in the database so that might returnnull
. So how is it possible to do basic arithmetic Operations in the Fixtures?The text was updated successfully, but these errors were encountered: