• Home
  • Events
  • About
  • Just some conversion tool…

    Aloha,

    Last week I was in Switzerland and somehow got reminded on some tool that I’ve created some time ago which might be handy for some of you. It is a simple unit conversion tool which supports conversion between the following categories of units:

    • ACCELERATION
    • ANGLE
    • AREA
    • DATA
    • CURRENT
    • ELECTRIC_CHARGE
    • ENERGY
    • FORCE
    • HUMIDITY
    • LENGTH
    • LUMINANCE
    • LUMINOUS_FLUX
    • MASS
    • PRESSURE
    • SPEED
    • TEMPERATURE
    • TEMPERATURE_GRADIENT
    • TIME
    • TORQUE
    • VOLUME
    • VOLTAGE
    • WORK

    As an example let’s convert a temperature in Celsius in Fahrenheit and Kelvin which would
    look as follows:

    So first you create a Converter instance with a category and a base unit (here Temperature as category and Celsius as base unit).

    After that is done you can convert celsius based temperatures to other units like Fahrenheit and Kelvin.

    In addition I’ve also added a method to shorten long numbers with abbreviations.

    Sometimes this is really useful when working with big numbers, a little example would look like follows…

    And the result will look like this…

    1.5M

    1M

    The format method will support the following abbreviations

    • kilo
    • Mega
    • Giga
    • Tera
    • Peta
    • Exa
    • Zetta
    • Yotta

    Not really sure if you can use it but at least I wanted to share it with you folks… 🙂

    The code is as always available on github.

    That’s it for today…keep coding…

    Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • email
    • Print
    • Twitter
    • LinkedIn
    • XING
    • Facebook
    • Google Bookmarks

    1 Comment »

    1. Tutorials To Learn said,

      January 27, 2018 @ 16:34

      Thanks for sharing…

    RSS feed for comments on this post

    Leave a Comment

    Time limit is exhausted. Please reload the CAPTCHA.

    css.php