From f2f5a34bd506c7b31ff859838467cebe3cfeb4b7 Mon Sep 17 00:00:00 2001 From: MiroChao <531414952@qq.com> Date: Thu, 2 Jan 2020 10:48:28 +0800 Subject: [PATCH] Update main.ts --- main.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.ts b/main.ts index d70f5c6..a1e98e1 100644 --- a/main.ts +++ b/main.ts @@ -260,9 +260,8 @@ namespace grove { //% blockId=grove_tm1637_display_number block="%strip|show number|%dispData" show(dispData: number) { - let compare_01:number = Math.floor(dispData / 10); - let compare_001:number = Math.floor(dispData / 100); - let compare_0001:number = Math.floor(dispData / 1000); + let compare_01:number = dispData % 100; + let compare_001:number = dispData % 1000; if(dispData < 10) { @@ -311,7 +310,7 @@ namespace grove { } else{ this.bit(Math.floor(dispData / 100) % 10, 1); } - if(compare_0001 > 9000){ + if(dispData > 9000){ this.bit(9, 0); } else{ this.bit(Math.floor(dispData / 1000) % 10, 0);