// AMD. Register as an anonymous module.
define([
"jquery",
+ "globalize",
"./core",
"./widget",
"./button"
// Browser globals
factory( jQuery );
}
-}(function( $ ) {
+}(function( $, Globalize ) {
function spinner_modifier( fn ) {
return function() {
_parse: function( val ) {
if ( typeof val === "string" && val !== "" ) {
- val = window.Globalize && this.options.numberFormat ?
- Globalize.parseFloat( val, 10, this.options.culture ) : +val;
+ // FIXME handle optional different locales
+ val = Globalize ? Globalize.parseNumber( val ) : +val;
}
+ // TODO: Why not to return NaN?
return val === "" || isNaN( val ) ? null : val;
},
if ( value === "" ) {
return "";
}
- return window.Globalize && this.options.numberFormat ?
- Globalize.format( value, this.options.numberFormat, this.options.culture ) :
- value;
+ // FIXME handle optional different locales
+ return Globalize ? Globalize.formatNumber( value, this.options.numberFormat ) : value;
},
_refresh: function() {