Sergey Rubanov

Results 240 comments of Sergey Rubanov

For some use cases it would be very useful to have `BigDecimal.prototype.decimalPlaces`. Note that `decimalPlaces` methods [from BigNumber.js](https://mikemcl.github.io/bignumber.js/#dp) and [from Decimal.js](http://mikemcl.github.io/decimal.js/#dp) will return `0` for `.00000` as `0` and `.00000`...

`round`, `floor` and `ceil` would be really useful. BigDecimal keeps number of decimal places, so all of them should accept parameter to get necessary precision. It could be a number...

Thinking again, number of decimal places could be more intuitive if we'll have `decimalPlaces` method ```js // `round` takes a number of decimal places bd1.round(bd2.decimalPlaces()); // instead of `-bd2.decimalPlaces()` //...

Yes, rounding modes are very useful indeed! For reference: - [Java rounding modes](https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/math/RoundingMode.html) - [Decimal.js rounding modes](http://mikemcl.github.io/decimal.js/#modes)

`HALF_UP` mode (which is default rounding mode in Decimal.js) could be useful for charts (like candle chart) to make them look better. `Math.round` in JavaScript uses what's named `HALF_CEIL` in...

`abs` is another frequently used function

@qzb it's in the IEEE 754 standard, I believe

ChakraCore PR https://github.com/Microsoft/ChakraCore/pull/5573

@bterlson @michaelficarra all major browsers has implemented these features. test262 already have tests ([flat]( https://github.com/tc39/test262/tree/master/test/built-ins/Array/prototype/flat), [flatMap]( https://github.com/tc39/test262/tree/master/test/built-ins/Array/prototype/flatMap)). It seems that proposal needs just PR to ecma262 to become ES2019

It could be too late for consensus when most of browsers will start to ship it on by default. - Chrome 69 will be released on September 4 - Firefox...