mirror of
https://github.com/luau-lang/rfcs.git
synced 2025-04-07 20:10:57 +01:00
Update explicit-accuracy-for-math-round.md
This commit is contained in:
parent
44c56624cf
commit
2079898433
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ local function round_to( n: number, decimal_places: number? )
|
|||
end
|
||||
print( round_to(3.1415, 2) ) -- Output: 3.14
|
||||
```
|
||||
The proposed change provides the same level of convenience as the above `round_to` function without impacting the--for lack of a better term--'visual' size of projects. The change is simple: introduce a second parameter to `math.round` which accepts `number?`s.
|
||||
The proposed change provides the same level of convenience as the above `round_to` function without impacting the--for lack of a better term--'visual' size of projects. The change is simple: introduce a second parameter to `math.round` which accepts a `number?`.
|
||||
```lua
|
||||
-- proposed change
|
||||
print( math.round(3.1415, 2) ) -- Output: 3.14
|
||||
|
|
Loading…
Add table
Reference in a new issue