Page 1 of 1
Math functions for more Label fields
Posted: Fri Jun 14, 2024 9:10 am
by nickvnlr
I would like to see the rounding and math functions available for more label fields.
UNIT MANIPULATION.jpg
Re: Math functions for more Label fields
Posted: Fri Jun 14, 2024 11:59 am
by jovivier
Hi Nick,
The rounding works with most keywords, is there one you have found where is doesn't work? You can have any rounding that you want, e.g., 0.00001.
It appears to work for me ACTFLOW.
What additional specific math are you requiring?
The current math format should work with all keywords:-
#<keyword><operator>[<number>]#
Where:
· <keyword> is an existing keyword
· <operator> depicts addition (+), subtraction (-), multiplication (*), division (/), power (^), modulus (| subtraction giving absolute result) or modulo (% remainder after division).
· <number> may be a constant number or another keyword.
I trust this helps.
The IRRICAD Team
Re: Math functions for more Label fields
Posted: Sat Jun 15, 2024 4:05 am
by nickvnlr
#ACTFLOW# does work, but #NUMEMIT# does not.
I have found the emitter number is a good stand-in for tree counts, but we like to estimate to the nearest 5 to take into account the inexact nature of the plant borders and/or other things in the fields that preclude an accurate count.
I am also unable to round #NUMTREE#
There might be more, but these are the first two that I have noticed.
Re: Math functions for more Label fields
Posted: Mon Jun 17, 2024 10:31 am
by Dan Crosby
Hi Nick,
We have typically only applied rounding to real numbers. Since the values you are interested in are integers, rounding doesn't work on them directly. This is the first time we've encountered a request to round integer values - mostly people want the exact number! With that said, you can round the integers by using maths to 'convert' them to real numbers, e.g.:
#NUMEMIT#
Round down: #NUMEMIT-[#NUMEMIT%[100]#]#
Round up: #NUMEMIT+[100.5];100.0#
giving:
6235
Round down: 6200
Round up: 6300
Regards,
Dan
Re: Math functions for more Label fields
Posted: Tue Jun 18, 2024 3:47 am
by nickvnlr
Thank you. So I can add a decimal to any integer to turn it into a real (float) variable and then round that?
Re: Math functions for more Label fields
Posted: Wed Jun 19, 2024 4:53 pm
by Dan Crosby
Hi Nick,
Yes it should work for any integer value. Note that that isn't the method used by the "round down" example though. That simply subtracts the remainder of dividing the number by the specified value (100) from the original value.
Regards,
Dan