@@ -538,7 +538,7 @@ function currency(value, symbol, decimals, options) {
538538 symbol = src_util . exist ( symbol ) ? symbol : globalOptions . symbol ;
539539 decimals = src_util . exist ( decimals ) ? decimals : globalOptions . decimalDigits ;
540540 options = options || globalOptions ;
541- var thousandsSeparator , symbolOnLeft , spaceBetweenAmountAndSymbol ;
541+ var thousandsSeparator , symbolOnLeft , spaceBetweenAmountAndSymbol , showPlusSign ;
542542 var digitsRE = / ( \d { 3 } ) (? = \d ) / g;
543543 value = parseFloat ( value ) ;
544544 if ( ! isFinite ( value ) || ! value && value !== 0 ) return '' ;
@@ -547,6 +547,7 @@ function currency(value, symbol, decimals, options) {
547547 thousandsSeparator = options . thousandsSeparator != null ? options . thousandsSeparator : ',' ;
548548 symbolOnLeft = options . symbolOnLeft != null ? options . symbolOnLeft : true ;
549549 spaceBetweenAmountAndSymbol = options . spaceBetweenAmountAndSymbol != null ? options . spaceBetweenAmountAndSymbol : false ;
550+ showPlusSign = options . showPlusSign != null ? options . showPlusSign : false ;
550551 var number = Math . abs ( value ) ;
551552 var stringified = toFixed ( number , decimals ) ;
552553 stringified = options . decimalSeparator ? stringified . replace ( '.' , options . decimalSeparator ) : stringified ;
@@ -561,7 +562,8 @@ function currency(value, symbol, decimals, options) {
561562 symbol = spaceBetweenAmountAndSymbol ? symbolOnLeft ? symbol + ' ' : ' ' + symbol : symbol ;
562563 symbol = symbolOnLeft ? symbol + head + _int . slice ( i ) . replace ( digitsRE , '$1' + thousandsSeparator ) + _float : head + _int . slice ( i ) . replace ( digitsRE , '$1' + thousandsSeparator ) + _float + symbol ;
563564 var sign = value < 0 ? '-' : '' ;
564- return sign + symbol ;
565+ var plusSign = value > 0 && showPlusSign ? '+' : '' ;
566+ return plusSign + sign + symbol ;
565567}
566568
567569function toFixed ( num , precision ) {
@@ -620,14 +622,17 @@ function ordinal(value, options) {
620622
621623/* harmony default export */ var other_ordinal = ( ordinal ) ;
622624// CONCATENATED MODULE: ./src/other/number.js
625+
623626/**
624627 * 123456 => '123,456'
625628 *
626629 * @params {Object} options
627630 *
628631 */
632+
629633function number_number ( value , format , options ) {
630634 var globalOptions = this && this . number ? this . number : { } ;
635+ format = src_util . exist ( format ) ? format : globalOptions . format ;
631636 options = options || globalOptions ;
632637 var config = parseFormat ( format ) ;
633638 var number = parseNumber ( value ) ;
0 commit comments