Package Exports
- @geylianlingier/digit-style
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@geylianlingier/digit-style) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Digit Style
Description
This Library converts numbers to printable digit styled strings.
In this library you can find the some classes and interfaces to simply create a nummerical digit display in console.
Eg. If you want to display a temperature more styled in the console.
___________________________
| _ _ _ _ |
| | _| _||_| |_| | |
| ||_ / _| | |_ |
|___________________________|For now, this is not fully integrated in the package, but this will be added soon.
You can find next listed classes /interfaces :
* DigitConverter class
Converts single numbers to instances of the Digit interface.
Converts full numbers to instances of the Digit interface.
Converts single characters (one char strings) to instances of the Digit interface.
Converts full string to instances of the Digit interface.
!Attention : The methods in this class converts only known characters and numbers. See table below.
You can access the single digits also by importing following chars/numbers :
existing characters Digit const Description 0, 1, 2,... -9 (also in string '0') ZERO,ONE,TWO,...By importing this const you have the instance of the digit interface class for this number. - MINUSBy importing this const you have the instance of the digit interface class for the minus char. Attention, this character can only give with a number or only as character. . COMMAWhen using full numbers with comma seperated values The same applies as with MINUS° DEGREEThis character can be used to display a temperature unit. Attention, this can only be used in character or string methods C CHAR_CThis character can also be used to display a temperature unit. I choose this notation instead of using Celcius, so that when I later decide to fully implement the class with all existing characters, I can still do that. The same is true asDEGREEThese Characters can also be found in the existingDigitCharacters.ts file.
* Digit (interface)
This interface represents an LED Digit Display. Each Digit consists of 7 controllable segments. (a,b,c,d,e,f,g)

This is represented in an object on the had of the corresponding letters.

{
a: false,
b: false,
c: true,
d: true,
e: true,
f: true,
g: true
}* printDigits class
With this class you can print all exisiting characters. See DigitConverterClass
toString(digit: Digit[])method :- This method gives you a string where all digits are converted to digit styled numbers in the string.
printDigits(digit: Digit[])method :- This method prints the digits to the console
Installation instructions
Make sure youre project is already an npm project:
npm initTo pull this project from npm you can use the next command :
npm i @geylianlingier/digit-styleUpdate package :
npm installRunning eslinter :
npm run lintVersions
v0.0.0
Set up project :
install all necessary libraries
- Typescript
- ts-node
- jest (tests)
adding index.ts file with hello world console.log
- This will be deleted in following versions
v0.1.0 Digit Converter
Added the Digit Converter class to the project
With this class you can convert numbers and string to digits with the existing digit numbers and characters.
v0.1.1 More Documentation
In this version, I added more documentation about the Digit Converter class.
v0.1.2 Seperate existing digit numbers
Because all of the numbers/characters are in the same document as the convertDigit class. I decide to seperate all the numbers/characters in a seperated file.
v0.2.0 NPM publish
add documentation for publishing to npm.
Go to npm package...
v0.2.1
In this version the package will be published for the first time on npm.
v0.3.0
In this version I added the printDigit class. This class prints out the digits styled numbers and characters.
Solve Bug in exisiting digits.
License
This Library is licenced with MIT. More Information
Author
I am Geylian, student Electronics-ICT in university Vives in Bruges. I create this library for an exam exercise for school.
For more projects like this check my Github :octocat: