Skip to content

Commit 274f158

Browse files
committed
feat: add support for specifying a format string
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent c045e40 commit 274f158

File tree

12 files changed

+386
-101
lines changed

12 files changed

+386
-101
lines changed

lib/node_modules/@stdlib/plot/table/unicode/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ The constructor accepts the following `options`:
7979

8080
- **corners**: table corner grapheme clusters (i.e., visual characters) in the order `[top-left, top-right, bottom-right, bottom-left]`. This is a shorthand option instead of specifying corner character sequences individually. Default: `[ '┌', '┐', '┘', '└' ]`.
8181

82+
- **format**: cell [format][@stdlib/string/format] string(s). Default: `'%s'`.
83+
8284
- **headers**: table headers.
8385

8486
- **headerSeparator**: header separator character(s). Default: `'─'`.
@@ -423,6 +425,30 @@ var data = ndarray2array( table.data );
423425

424426
The returned [ndarray][@stdlib/ndarray/ctor] is a **read-only** view of table data.
425427

428+
<a name="prop-format"></a>
429+
430+
#### UnicodeTable.prototype.format
431+
432+
Cell [format][@stdlib/string/format] string(s) for rendering cell contents.
433+
434+
```javascript
435+
var table = new UnicodeTable();
436+
437+
// Set:
438+
table.format = '%d';
439+
440+
// Get:
441+
var fmt = table.format;
442+
// returns '%d'
443+
444+
// Set:
445+
table.format = [ '%s', '%d' ];
446+
447+
// Get:
448+
fmt = table.format;
449+
// returns [ '%s', '%d' ]
450+
```
451+
426452
<a name="prop-headers"></a>
427453

428454
#### UnicodeTable.prototype.headers
@@ -1021,6 +1047,8 @@ console.log( str );
10211047

10221048
[@stdlib/ndarray/ctor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/ndarray/ctor
10231049

1050+
[@stdlib/string/format]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/format
1051+
10241052
<!-- <related-links> -->
10251053

10261054
<!-- </related-links> -->

0 commit comments

Comments
 (0)