Add toPrecision to Number

This commit is contained in:
Jonathan Sundqvist
2018-06-23 18:18:58 +02:00
parent bf56d5815b
commit f636f7b28d
2 changed files with 38 additions and 0 deletions

View File

@ -213,6 +213,13 @@ extern {
extern {
pub type Number;
/// The toPrecision() method returns a string representing the Number
/// object to the specified precision.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toPrecision
#[wasm_bindgen(catch, method, js_name = toPrecision)]
pub fn to_precision(this: &Number, precision: u8) -> Result<String, JsValue>;
/// The toString() method returns a string representing the
/// specified Number object.
///