Spinner: Changed casing of option numberformat -> numberFormat.

This commit is contained in:
Scott González 2011-05-20 16:25:04 -04:00
parent 63b89b7884
commit af35f0bbc9
5 changed files with 13 additions and 13 deletions

View File

@ -27,7 +27,7 @@
max: 2500,
step: 25,
start: 1000,
numberformat: "C"
numberFormat: "C"
});
});

View File

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

View File

@ -4,7 +4,7 @@ commonWidgetTests( "spinner", {
incremental: true,
max: null,
min: null,
numberformat: null,
numberFormat: null,
page: 10,
step: null,
value: null,

View File

@ -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");

View File

@ -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() {