Closed signalno11 closed 1 year ago
(This would be pretty easy I figure, I'm just having trouble finding where this function is programmed)
What's the use case behind this? I could understand the need for this in an e.g. programming language, but how would it be helpful in Insect?
@mhmdanas being able to quickly round to numbers other than whole numbers would be useful for a variety of reasons, e.g. you're stupid like I am
I'm in favor of implementing this, but I'm currently not sure if we have support for functions like this (with optional or defaulted parameters). We definitely want to maintain the single-parameter version.
Also, let's make sure that the two-parameter version is close in behavior to existing two-parameter versions of round
in e.g. Python.
I'm in favor of implementing this, but I'm currently not sure if we have support for functions like this (with optional or defaulted parameters). We definitely want to maintain the single-parameter version.
Yeah, we don't have anything like that at the moment, but I think it wouldn't be too difficult to implement.
Also, let's make sure that the two-parameter version is close in behavior to existing two-parameter versions of round in e.g. Python.
Agreed, researching what popular languages do by default is a good idea.
If someone still thinks this is valuable, please open a follow-up ticket in the https://github.com/sharkdp/numbat project.
For example, round(x,y) x would be the number to round y would be how many digits to include
round(1.11111,1) would return "1" round(1.11111,2) would return "1.1" and so on....