Skip to content

sunkf/SmartTools

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Tools for micro:bit

Smart Tools pxt extension for micro:bit

Alt text

Basic Usage

let x = 0
x = 123.52
basic.showString(smarttools.intToString(
123.1
))
basic.showNumber(smarttools.stringToInt(
"12.3"
))
basic.showNumber(smarttools.round(
12.5
))
basic.showNumber(smarttools.roundUp2PositiveInfinity(
12.5
))
basic.showNumber(smarttools.roundDown2NegativeInfinity(
12.5
))
basic.showNumber(smarttools.round2Zero(
12.5
))
basic.forever(function () {
	
})

Use ||intToString|| to convert int to string (removing fractions).

Use ||stringToInt|| to convert string to int (removing fractions).

Use ||round|| to convert decimal to int with round.

Use ||roundUp2PositiveInfinity|| to convert decimal to int with round up to positive infinity.

Use ||roundDown2NegativeInfinity|| to convert decimal to int with round down to negative infinity.

Use ||round2Zero|| to convert decimal to int with round to zero.

Use ||hex2Dec|| to convert hex to decimal with round to zero.

Use ||dec2Hex|| to convert decimal to hex with round to zero.

Demo

Alt text

Supported targets

  • for PXT/microbit

License

MIT

About

Smart tools pxt for micro:bit

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%