Skip to content

toktx's ceilMultipleOfFour breaks on numbers with small fraction #1782

@upisfree

Description

@upisfree

This code will break on numbers with small fraction:

Image

function ceilMultipleOfFour(value: number): number {
if (value <= 4) return 4;
return value % 4 ? value + 4 - (value % 4) : value;
}

I found this solution working for this case:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions