Hi
I need a formula to set the result of the number of decimal of a division to 1 if integer and 2 if fraction.
Example: If the result is 10.00 then 10
If the result is 0.83 then 0.83
I know this can be done under Format Field, but in this case this formula will be used by another formula, that will concatenate its result.
Hi Abhilash
Thank you for your reply, but as I mentioned, that doesn't seem to work in this case.
The current formula is in a group footer and is as below
TOTEXT (Sum ({@qty_conversion_to_bottles}, {'Sales_Data_'.Customer}),0)& "/"&({@bottles_to_cases})
So I am concatenating a summary and a formula there, and I need a formula for the @bottles_to_cases to return the desidered number of decimals.
In the @bottles_to_cases I have the following division
Sum ({@qty_conversion_to_bottles}, {'Sales_Data_'.Customer})/12
Change @bottles_to_cases
Local NumberVAR Bottles:=Sum ({@qty_conversion_to_bottles}, {'Sales_Data_'.Customer})/12;
Local NumberVAR Bottles:=Sum ({@qty_conversion_to_bottles}, {'Sales_Data_'.Customer})/12; if bottles - int(bottles)= 0 then totext(bottles, 0) else totext(bottles, 2)
Ian
Hi Rony,
Right-click the field > format field > Number tab > Click the Customize button > click the formula button beside 'Decimals' and use this code:
if currentfieldvalue - int(CurrentFieldValue) = 0 then 0 else 2
-Abhilash
Hi Rony,
Try this code:
local numbervar btc := {@bottles_to_cases}; if btc - int(btc) = 0 then btc := totext({@bottles_to_cases},0) else btc := totext({@bottles_to_cases},2); TOTEXT (Sum ({@qty_conversion_to_bottles}, {'Sales_Data_'.Customer}),0)& "/"& btc;
-Abhilash
Hello Ian
Worked beautifully, thank you!
Hi Abhilash
Thank you also for your imput!