• VeganPizza69 Ⓥ@lemmy.world
    link
    fedilink
    arrow-up
    11
    arrow-down
    4
    ·
    5 months ago

    The high level setter function should be made to handle both string and numeric values.

    If it contains “%” it’s a percentage value.

    If it’s a string without a “%” it’s an absolute value and needs to be normalized.

    If it’s a numeric value, it’s an absolute value.

    If it’s a numeric 100, it’s 100%.

    If it’s a subunitary numeric value, it’s a percentage.