I’m curious if anyone has tried advanced features using the math.js API call. I’ve only had success with simple functions, but I would love to build out an API call that goes something like this:
{
“expr”: “if {{pre.year_calc.result}}=-1
return({{ursp.MSRP}}1.005)
if {{pre.year_calc.result}}=0
return({{ursp.MSRP}}.96.005)
// Continue pattern 15 more times//”
}
Is this possible @arnav/@vinit? It would sure save me a ton of extra gambits if so. Basically I’m trying to build a registration fee calculator, which would be easy enough, but there is a secondary fee that must be calculated that takes the model year minus the current calendar year to determine a depreciation percentage which in turn is multiplied against the MSRP of the vehicle and then multiplied by .5% to determine the extra fee, which will be added to the other fees at the end.
There are other conditions that apply if a vehicle year determination is over 16, but that is easily handled through a simple calculation and conditional jump logic, which only requires to separate gambits making a Math.js call (though I could use the above technique to combine them if it is possible).
Anyone curious about Math.js can find it here. This is the same API that is used to calculate the number of correct answers in a quiz in your bot (much simpler process).