<div class="yui3-g">
    <div class="yui3-u-1-2">
      <form id="demo">
        <fieldset>
           <label for="demo_input">Value to parse: <input type="text" id="demo_input"></label>
           <input type="button" id="demo_btn" value="Report parsed number">
        </fieldset>
      </form>
    </div>
    <div class="yui3-u-1-2">
        The parsed number is: <span id="parsed_number"></span>
    </div>
</div>

<script>
YUI().use("node", "datatype-number", function (Y) {
    Y.on("click", function(e){
        
        var input = Y.one("#demo_input").get("value"),
            output = Y.Number.parse(input);
                
        if(output === "") {
            output += "(Invalid value)"
        }
        
        if (output == null) {
            output = "null";
        }

        Y.one("#parsed_number").set("text", output);
    }, "#demo_btn");
});
</script>
