Hello. My first post here, so please be gentle
I have the following scenario
The price for renting Video Equipment is different based on how long you rent it …
1-6 days, price A
7-27 days, price B
28 days +, price C
Each of the prices is rental for ONE DAY (24 hours)
So the Price is multiplied with the number of days … so far so good,
The Prices are calculated in the Equipment Tab
The amount for the Rental is calculated in the Rentals Tab
I have managed to come up with a nesten IF statement, that prints to a STATUS field, and that works just fine … is prints something like “Singel day Price”, “Weekly Price” and “Monthly Price”
It goes like …
IF(DATETIME_DIFF({End},{Start},“d”)<7,“Daily Price”,IF(DATETIME_DIFF({End},{Start},“d”)<=27,“Week Price”,IF(DATETIME_DIFF({End},{Start},“d”)<=90,“Month Price”,"")))
pardon my translation
Now I try to do the same for the actual price.
In the Equipment database all the prices are created by a calculation
as an example … the price for an single day is calculated as (({PriceOfPurchase}/10)/7)*1.25 … formatted as Integer
I use lookup logic to bring these values into the Rental database Tab
I have also calculated the DAYS for the rental
So …
IF(Days<7,{Daily Price},IF(Days<28,{Week Price},IF(Days<90,{Month Price},"")))
and I end up with something like …
356.3686745875872
The 356 is supposed to be the price … and the number of digits after the point/comma is not constant
With my current knowledge about AirTable … I am not able to get rid of all digits after the comma … and believe me … I have tried …
I am also not able to use the result in any calculation, as AirTable does not recognize it as a number.
Please help
Kind regards Nils