Skip to content

Commit 231f040

Browse files
committed
Auto-generated commit
1 parent e0b11f9 commit 231f040

File tree

9 files changed

+781
-257
lines changed

9 files changed

+781
-257
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
<section class="release" id="unreleased">
66

7-
## Unreleased (2026-02-23)
7+
## Unreleased (2026-02-27)
88

99
<section class="features">
1010

1111
### Features
1212

13+
- [`793a38c`](https://github.com/stdlib-js/stdlib/commit/793a38c29f31677807e0cf6748f1ca54fbbef4ec) - add `toLocaleString` method to `ndarray/base/ctor` [(#9435)](https://github.com/stdlib-js/stdlib/pull/9435)
1314
- [`7b69002`](https://github.com/stdlib-js/stdlib/commit/7b69002e03bd424815f80e156e0994f150e80175) - ensure support for non-string dtypes and update tests to use functional accessors
1415
- [`aa9da1e`](https://github.com/stdlib-js/stdlib/commit/aa9da1e984009479baafb731970c49c0e2b0d423) - update `ndarray/base` TypeScript declarations [(#9935)](https://github.com/stdlib-js/stdlib/pull/9935)
1516
- [`3d21748`](https://github.com/stdlib-js/stdlib/commit/3d2174821f71a70dbb3052da07e0a3b3f6dfbaa0) - add function to return the index offset in units of elements
@@ -737,6 +738,7 @@ A total of 43 issues were closed in this release:
737738

738739
<details>
739740

741+
- [`793a38c`](https://github.com/stdlib-js/stdlib/commit/793a38c29f31677807e0cf6748f1ca54fbbef4ec) - **feat:** add `toLocaleString` method to `ndarray/base/ctor` [(#9435)](https://github.com/stdlib-js/stdlib/pull/9435) _(by Muhammad Haris, Athan Reines)_
740742
- [`a7bf4ae`](https://github.com/stdlib-js/stdlib/commit/a7bf4aec94324369038c58bc51206f9397e59e16) - **bench:** refactor to use string interpolation in `ndarray/zeros-like` [(#10366)](https://github.com/stdlib-js/stdlib/pull/10366) _(by Shubham)_
741743
- [`6a0008d`](https://github.com/stdlib-js/stdlib/commit/6a0008d0315752288d76406de68fbcdc3b3015e5) - **bench:** refactor to use string interpolation in `ndarray/zeros` [(#10369)](https://github.com/stdlib-js/stdlib/pull/10369) _(by Shubham)_
742744
- [`0ae8a91`](https://github.com/stdlib-js/stdlib/commit/0ae8a917f3759d3228e59c3945b348398a21c7b7) - **docs:** remove extra empty line [(#10168)](https://github.com/stdlib-js/stdlib/pull/10168) _(by stdlib-bot)_

base/ctor/README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,11 +510,44 @@ var d = arr.data;
510510

511511
For 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

Comments
 (0)