Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update number.md #436

Closed
wants to merge 7 commits into from
Closed
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions doc/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ Creates a new instance of a `Napi::Number` object.
Napi::Number(napi_env env, napi_value value);
```

- `[in] env`: The `napi_env` environment in which to construct the `Napi::Nuber` object.
- `[in] value`: The `napi_value` which is a handle for a JavaScript `Number`.
- `[in] env`: The `napi_env` environment in which to construct the `Napi::Number` object.
- `[in] value`: The primitive to wrap.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this explanation is too brief. How about "The JavaScript value holding a number."?



Returns a non-empty `Napi::Number` object.

Expand All @@ -36,8 +37,8 @@ Napi::Number(napi_env env, napi_value value);
```cpp
Napi::Number Napi::Number::New(napi_env env, double value);
```
- `[in] env`: The `napi_env` environment in which to construct the `Napi::Nuber` object.
- `[in] value`: The `napi_value` which is a handle for a JavaScript `Number`.
- `[in] env`: The `napi_env` environment in which to construct the `Napi::Number` object.
- `[in] value`: The C++ primitive from which to instantiate the `Napi::Value`. `value` must be a `c++ double`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the explanation here should be "The value from which to instantiate the `Napi::Number`".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that the value is a double should be obvious from the prototype.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just keeping in sync with the String one. Ensuring it's similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! Hope it's better now.


Creates a new instance of a `Napi::Number` object.

Expand Down