git ssb

0+

Rômulo Alves / plainbudget



Commit 9964c6e5e9636cdc8b3f37a5cda9e898425b9583

Round numbers

Rômulo Alves committed on 8/30/2018, 4:43:28 PM
Parent: 803af62eca94e1a31162f52261b03aacd31cd8b2

Files changed

index.jschanged
index.jsView
@@ -1,8 +1,12 @@
11
22 const NAME_REGEX = /^([a-z0-9\-.\/ ]+)$/i // eslint-disable-line
33 const MULTIPLIER_REGEX = /^(.*?)\s+x\s+(\d+)$/
44
5 +function round(value) {
6 + return Math.round(value * 100) / 100
7 +}
8 +
59 module.exports = class Plainbudget {
610
711 static computeSheet (sheet) {
812 const pb = new Plainbudget(sheet)
@@ -257,8 +261,10 @@
257261 }
258262 }
259263 }
260264
265 + value = round(value)
266 +
261267 if (group[0][0] === '=') {
262268 group[0][1] = value
263269 this.setNamed(group[0][2], value)
264270 } else {

Built with git-ssb-web