1.0.65 • Published 6 years ago

u-redux v1.0.65

Weekly downloads
105
License
DO_WHATEVER_YOU_W...
Repository
github
Last release
6 years ago

num-converter-js

A small OO number converter in Js. Convert (hex|dec|bin) to/from (hex|dec|bin).

Version License Build Status

Prerequisites

  • NodeJs / NPM

Installation

  cd /path/to/your/project
  npm i num-converter-js

Testing

From your application code.

  const numConv = require('num-converter-js')
  const myHexNum = numConv.decToHex(10)

API

Class: NumberConverterJs

Under ongoing development, but all methods stable as of 0.1.0. (Binary coming soon.)

  const htd = numberConverterJs.hexToDec, dth = numberConverterJs.decToHex
  const hex1 = '0x123f', hex2 = '123f', hex3 = 123,
        dec1 = '123', dec2 = '1.23', dec3 = 0.123, dec4 = .123

  // Returns Decimal Values
  console.log(`h2d1: ${htd(hex1)} h2d2: ${htd(hex2)} h2d3: ${htd(hex3)}`)

  // Returns Hex Values
  console.log(`d2h1: ${dth(dec1)} d2h2: ${dth(dec2)} d2h3: ${dth(dec3)} d2h4: ${dth(dec4)}`)

Use hexToDec && decToHex methods to convert numbers. The variable above indicate all of the forms in which you can pass values to the respective functions.


Methods

numConverterJs.hexToDec(hexValue)

  • hexValue - (string|number) - 0x123f, 123f or 123

Returns a Decimal Value.


numConverterJs.decToHex(decValue)

  • decValue - (string|number) - 123, 1.23, 0.123 or .123

Returns a Hex Value.


Contributing

Not currently accepting outside contributors, but feel free to clone, modify and use as you wish.

Authors

License

This project is licensed under the DO_WHATEVER_YOU_WANT License - see the LICENSE file for details

1.0.65

6 years ago

1.0.64

6 years ago

1.0.63

6 years ago

1.0.62

6 years ago

1.0.61

6 years ago

1.0.60

6 years ago

1.0.59

6 years ago

1.0.58

6 years ago

1.0.57

6 years ago

1.0.56

6 years ago

1.0.55

6 years ago

1.0.54

6 years ago

1.0.53

6 years ago

1.0.52

6 years ago

1.0.51

6 years ago

1.0.50

6 years ago

1.0.49

6 years ago

1.0.48

6 years ago

1.0.47

6 years ago

1.0.46

6 years ago

1.0.45

6 years ago

1.0.44

6 years ago

1.0.43

6 years ago

1.0.42

6 years ago

1.0.41

6 years ago

1.0.40

6 years ago

1.0.36

6 years ago

1.0.35

6 years ago

1.0.34

6 years ago

1.0.33

6 years ago

1.0.32

6 years ago

1.0.31

6 years ago

1.0.30

6 years ago

1.0.29

6 years ago

1.0.28

6 years ago

1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.5

6 years ago

1.0.0

6 years ago