From dff3c9bf7689b74e50bf1409886322af76c7d99d Mon Sep 17 00:00:00 2001 From: adambla76 Date: Sun, 10 Nov 2019 19:15:29 +0100 Subject: [PATCH] math.floor fix --- main.ts | 12 ++++++------ pxt.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.ts b/main.ts index dea58a3..768cb24 100644 --- a/main.ts +++ b/main.ts @@ -270,23 +270,23 @@ namespace grove { else if(dispData < 100) { this.bit(dispData % 10, 3); - this.bit((dispData / 10) % 10, 2); + this.bit(Math.floor(dispData / 10) % 10, 2); this.bit(0x7f, 1); this.bit(0x7f, 0); } else if(dispData < 1000) { this.bit(dispData % 10, 3); - this.bit((dispData / 10) % 10, 2); - this.bit((dispData / 100) % 10, 1); + this.bit(Math.floor(dispData / 10) % 10, 2); + this.bit(Math.floor(dispData / 100) % 10, 1); this.bit(0x7f, 0); } else { this.bit(dispData % 10, 3); - this.bit((dispData / 10) % 10, 2); - this.bit((dispData / 100) % 10, 1); - this.bit((dispData / 1000) % 10, 0); + this.bit(Math.floor(dispData / 10) % 10, 2); + this.bit(Math.floor(dispData / 100) % 10, 1); + this.bit(Math.floor(dispData / 1000) % 10, 0); } } diff --git a/pxt.json b/pxt.json index 15903fd..ba933d7 100644 --- a/pxt.json +++ b/pxt.json @@ -1,6 +1,6 @@ { "name": "Grove", - "version": "0.1.6", + "version": "0.1.7", "description": "A Microsoft MakeCode package for Seeed Studio Grove module", "license": "MIT", "dependencies": {