@@ -510,11 +510,44 @@ var d = arr.data;
510510
511511For zero-dimensional arrays, the first, and ** only** , argument should be the value ` v ` to set. The method returns the ` ndarray ` instance.
512512
513+ <a name =" method-to-locale-string " ></a >
514+
515+ #### ndarray.prototype.toLocaleString( \[ locales\[ , options]] )
516+
517+ Serializes an ` ndarray ` as a locale-specific string.
518+
519+ ``` javascript
520+ // Specify the array configuration:
521+ var buffer = [ 1234.567 , 9876.543 , 1111.222 , 3333.444 ];
522+ var shape = [ 2 , 2 ];
523+ var order = ' row-major' ;
524+ var strides = [ 2 , 1 ];
525+ var offset = 0 ;
526+
527+ // Create a new ndarray:
528+ var arr = ndarray ( ' generic' , buffer, shape, strides, offset, order );
529+
530+ // Serialize to a locale-specific string:
531+ var str = arr .toLocaleString ( ' en-US' );
532+ // returns "ndarray( 'generic', [ 1,234.567, 9,876.543, 1,111.222, 3,333.444 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' )"
533+
534+ // Use German locale:
535+ str = arr .toLocaleString ( ' de-DE' );
536+ // returns "ndarray( 'generic', [ 1.234,567, 9.876,543, 1.111,222, 3.333,444 ], [ 2, 2 ], [ 2, 1 ], 0, 'row-major' )"
537+ ```
538+
539+ The method accepts the following arguments:
540+
541+ - ** locales** : a string with a BCP 47 language tag or an array of such strings.
542+ - ** options** : configuration properties.
543+
544+ The method does ** not** serialize data outside of the buffer region defined by the array configuration.
545+
513546<a name =" method-to-string " ></a >
514547
515548#### ndarray.prototype.toString()
516549
517- Serializes an ` ndarray ` as a ` string ` .
550+ Serializes an ` ndarray ` as a string.
518551
519552``` javascript
520553// Specify the array configuration:
0 commit comments