Nerdy People Matriculate

    knockout.integer

    2.0.1 • Public • Published

    Knockout Integer Extender

    A simple knockout extender which coerces values to integers.

    Installation

    npm install knockout-integer
    

    Then add knockout-integer.js to your project.

    Usage

    require the script in your bundle. Then:

    var myNumber = ko.observable().extend({integer: 0 /* optional default value if it cannot be coerced to integer */});
    myNumber("17000");
     
    console.log(myNumber()); //17000
    console.log(myNumber.formatted()); //17,000

    Keywords

    none

    Install

    npm i knockout.integer

    DownloadsWeekly Downloads

    2

    Version

    2.0.1

    License

    MIT

    Last publish

    Collaborators

    • chadly
    • mdarens
    • tullo_x86