Timeline for Round number to nearest non zero digit
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 14, 2021 at 21:00 | history | tweeted | twitter.com/StackCodeReview/status/1415415807950139394 | ||
Jul 10, 2021 at 14:48 | answer | added | Reinderien | timeline score: 3 | |
Jul 10, 2021 at 7:27 | comment | added | CodeReview123123 | @Reinderien Yes its for display, could you tell me the better formats you're talking about? Thanks again | |
Jul 10, 2021 at 3:28 | comment | added | Reinderien | I'm afraid that this entire procedure has a bad-idea fragrance. If you're formatting these values for display only, there are better formats. If this is part of an analysis routine you probably shouldn't be rounding at all. | |
Jul 10, 2021 at 0:07 | answer | added | FMc | timeline score: 4 | |
Jul 9, 2021 at 23:10 | comment | added | CodeReview123123 | @Reinderien Hi, thank you for the question. I am creating a price checker and some of the coins/tokens are fractions of pennies. Some could be: 0.000000000012313149 and i am only interested in rounding to the nearest non zero digit: 0.00000000001. the reason i have abs() is because some i am also checking the price change within the last 24 hours and the API I use sends back scientific notation (which is why i have {number.99f}and negative numbers (-0.00000000123 for example) abs(). The abs() is not required in this method. I hope this helps and explains things a little bit more | |
Jul 9, 2021 at 22:52 | comment | added | Reinderien |
Why would you do this in the first place? This is not only a rounding function, since there is an abs in the mix.
|
|
Jul 9, 2021 at 22:14 | history | asked | CodeReview123123 | CC BY-SA 4.0 |