Function string #
创建一个字符串或将任何对象转换为字符串。数组和矩阵的元素是逐个处理的。
Syntax #
math.string(value)
Parameters #
| Parameter | Type | Description |
|---|---|---|
value |
* | Array | Matrix | null | 要转换为字符串的值 |
Returns #
| Type | Description |
|---|---|
| string | Array | Matrix | 创建的字符串 |
Throws #
Type | Description —- | ———–
Examples #
math.string(4.2) // returns string '4.2'
math.string(math.complex(3, 2)) // returns string '3 + 2i'
const u = math.unit(5, 'km')
math.string(u.to('m')) // returns string '5000 m'
math.string([true, false]) // returns ['true', 'false']