- for ( whole = valueParts[ 0 ]; whole; ) {
- off = groupSize ? whole.length - groupSize : 0;
- pieces.push( ( off > 0 ) ? whole.slice( off ) : whole );
- whole = ( off > 0 ) ? whole.slice( 0, off ) : '';
-
- if ( groupSize2 ) {
- groupSize = groupSize2;
- groupSize2 = null;
+ if (
+ options.minimumGroupingDigits === null ||
+ valueParts[ 0 ].length >= groupSize + options.minimumGroupingDigits
+ ) {
+ for ( whole = valueParts[ 0 ]; whole; ) {
+ off = groupSize ? whole.length - groupSize : 0;
+ pieces.push( ( off > 0 ) ? whole.slice( off ) : whole );
+ whole = ( off > 0 ) ? whole.slice( 0, off ) : '';
+
+ if ( groupSize2 ) {
+ groupSize = groupSize2;
+ groupSize2 = null;
+ }