Skip to content
Permalink
Browse files

Spinner: Changed casing of option numberformat -> numberFormat.

  • Loading branch information
scottgonzalez committed May 20, 2011
1 parent 63b89b7 commit af35f0bbc9064ec66bee19c730bf4cb9de2834db
@@ -27,7 +27,7 @@
max: 2500,
step: 25,
start: 1000,
numberformat: "C"
numberFormat: "C"
});

});
@@ -18,7 +18,7 @@
$(function() {
$("#spinner").spinner({
step: 0.01,
numberformat: "n"
numberFormat: "n"
});

$("#culture").change(function() {
@@ -4,7 +4,7 @@ commonWidgetTests( "spinner", {
incremental: true,
max: null,
min: null,
numberformat: null,
numberFormat: null,
page: 10,
step: null,
value: null,
@@ -5,26 +5,26 @@

module("spinner: options");

test("numberformat, number", function() {
test("numberFormat, number", function() {
var el = $("#spin").spinner({
value: "1",
numberformat: "n"
numberFormat: "n"
});
equal(el.val(), "1.00");
});

test("numberformat, number, simple", function() {
test("numberFormat, number, simple", function() {
var el = $("#spin").spinner({
value: "1",
numberformat: "n0"
numberFormat: "n0"
});
equal(el.val(), "1");
});

test("numberformat, currency", function() {
test("numberFormat, currency", function() {
var el = $("#spin").spinner({
value: "1",
numberformat: "C"
numberFormat: "C"
});
equal(el.val(), "$1.00");
});
@@ -111,7 +111,7 @@ test("step, 2", function() {
test("step, 0.7", function() {
var el = $("#spin").spinner({
step: 0.7,
numberformat: "n1"
numberFormat: "n1"
});
equals(el.val(), "0.0", "value initialized to");

@@ -20,7 +20,7 @@ $.widget( "ui.spinner", {
incremental: true,
max: null,
min: null,
numberformat: null,
numberFormat: null,
page: 10,
step: null,
value: null
@@ -318,13 +318,13 @@ $.widget( "ui.spinner", {

_parse: function( val ) {
if ( typeof val === "string" ) {
val = $.global && this.options.numberformat ? $.global.parseFloat( val ) : +val;
val = $.global && this.options.numberFormat ? $.global.parseFloat( val ) : +val;
}
return isNaN( val ) ? null : val;
},

_format: function( num ) {
this.element.val( $.global && this.options.numberformat ? $.global.format( num, this.options.numberformat ) : num );
this.element.val( $.global && this.options.numberFormat ? $.global.format( num, this.options.numberFormat ) : num );
},

destroy: function() {

0 comments on commit af35f0b

Please sign in to comment.
You can’t perform that action at this time.