Hi schamblee, Thank you for your response!
I appreciate that the ceiling function rounds up but I dont think it gives me the ability to 'specify' the point at which it will round up!
to explain - If the calculation says I need 1.10 (upto 1.20) trays sowing, I would like the formula to round down to 1 tray. If the result says I need 1.30 (or above) trays sowing I would like the formular to round up to 2.
you can use Ceiling ( DecimalTrays - .3 )
... a zero result is possible, if the DecimalTrays <= .3
ahem, sorry ...
Ceiling ( DecimalTrays - .2 );
p.s. to annotate the above ... the threshold is set at .2 (20% of a single tray). The subtraction "rounds down" your decimal/rational tray number value, per your specification; and Ceiling "rounds" up to the next integer. The Max function with the parameter 1 ensures a minimum of one tray.
Would this work?: Round ( .25 + ( field1 / field2 ) ; 0 )
Int ( Trays ) + getAsBoolean ( ( 4 * ( Trays - Int ( Trays ) ) ) ≥ 1 )
I think if you have a specific requirement like that you need to construct a specific calc. The best way to do so is in a Let ( ) function, where you can specify whatever parameters you require, for example:
number = <inputFromYourField>
; fraction = Mod ( number ; 1 )
; limit = 0.2
; result = If ( fraction ≤ limit ; Floor ( number ) ; Ceiling ( number ) )
This calc extracts the modulus (i.e. the fraction part) and tests that against the set limit, then uses either the Floor or Ceiling function to set the resulting whole number—1.20 would result in 1, anything above that would result in 2. Try it and see if it suits your need.
This is great guys, thank you!
ill give them a try and let you know which works best! Thanks again!
I went for the following calc.
If ( IsEmpty ( Packs Required ) ; 0 ; Max (Ceiling ((Packs Required * Container) / (BKGrowersSeedTray / 100 * Plant Details export file 2016 v1::Percentage Emergance)-.3); 1 ) )
I added the "if" so the field would return zero, rather than showing One as a minimum number of trays to be sown.
Thank you for your help