Skip to content

Support for number pre- and postfixes.

Given that EvalEx does not support implicit multiplication (like a = 5; a3 = 15) we could use that to support simple pre- and postfixes of numbers, like that:

#1    EUR 5 * 20    = EUR 100
#2    $4.87 * 4     = $19.48
#3    5cm * 4       = 20cm
#4    5cm * 5cm     = 25cm^2
#5    5cm / 5cm     = 25
#6    15 / 5cm      = 3 1/cm
#7    10cm^2 / 2cm  = 5cm
#8    25$ / 5cm     = 5$/cm

Obviously, this allows nonsensical input like this:

#1    5$ * 5$       = 25$^2

But I don't think that that should be a supported case, having a list of pretty much every unit out there sounds very impractical. It might be feasible, if user extendable, but ultimately will be considered out of scope for this feature, if needed a separate issue should be logged.