diff --git a/README.md b/README.md index 42b7f1e..94b9e4f 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,29 @@ import numesis module on your project directly ```js import Numesis from 'https://deno.land/x/numesis/mod.ts' ``` +## Example +```js +const hex = new Numesis("0123456789ABCDEF"); +const dec = new Numesis("0123456789"); +const bin = new Numesis("01"); +const oct = new Numesis("01234567"); + +console.log(`Hex value of 255 is ${hex.e(255)}`); +// Output: Hex value of 255 is FF + +console.log(`Oct value of 255 is ${oct.e(255)}`); +// Output: Oct value of 255 is 377 + +console.log(`Dec value of 255 is ${dec.e(255)}`); +// Output: Dec value of 255 is 255 + +console.log(`Bin value of 255 is ${bin.e(255)}`); +// Output: Bin value of 255 is 11111111 + +// Convert RGB Color +console.log(`Convert RGB(255,255,255) to HEX is ${hex.e(255,255,255)}`); +// Output: Covert RGB(255,255,255) to HEX is FFFFFFFF +``` ## Usage ### With deno ```js