UNPKG

1.02 kBMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function string
4
5Create a string or convert any object into a string.
6Elements of Arrays and Matrices are processed element wise.
7
8
9## Syntax
10
11```js
12math.string(value)
13```
14
15### Parameters
16
17Parameter | Type | Description
18--------- | ---- | -----------
19`value` | * &#124; Array &#124; Matrix &#124; null | A value to convert to a string
20
21### Returns
22
23Type | Description
24---- | -----------
25string &#124; Array &#124; Matrix | The created string
26
27
28## Examples
29
30```js
31math.string(4.2) // returns string '4.2'
32math.string(math.complex(3, 2) // returns string '3 + 2i'
33
34const u = math.unit(5, 'km')
35math.string(u.to('m')) // returns string '5000 m'
36
37math.string([true, false]) // returns ['true', 'false']
38```
39
40
41## See also
42
43[bignumber](bignumber.md),
44[boolean](boolean.md),
45[complex](complex.md),
46[index](index.md),
47[matrix](matrix.md),
48[number](number.md),
49[unit](unit.md)