Skip to content

2 new number matchers (test if a number is an interger or a float) #37

@jeromedecoster

Description

@jeromedecoster

Hello,

It's sometime usefull to test if a number is an integer or a float.
Perhaprs a good idea to add IsIntMatcher and IsFloatMatcher

I gave you the correct functions below:
function isInt(value:Number):Boolean
{
return (value % 1 == 0);
}

function isFloat(value:Number):Boolean
{
    return (value % 1 != 0);
}

Thanks !

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