savingsPercent

fun savingsPercent(baseMicros: Long, basePeriod: String?, comparedMicros: Long, comparedPeriod: String?): Int

Percentage saved by paying comparedMicros per comparedPeriod instead of baseMicros per basePeriod, normalized to a common cadence.

Typical use is "yearly vs monthly": pass the monthly plan as the base. Returns 0 when either side is unusable (missing price, unparseable period, zero-length period) or when the compared plan is not cheaper.

Return

whole-percent saving in 0..100.