Live data from Hacker News

Show HN: I created Units Converter that contains 5000 units across 78 categories

kodytools.com

31–40 of 137 posts

Re: Show HN: I created Units Converter that contains 5000 units across 78 categories

#31
post #5

The first thing I looked for was football fields, but couldn't find it. :)

I will add it by today. It will be available in Area category by tomorrow. Thanks for letting me know. I just add units as soon as somebody let me know by twitter or email.

Don't forget "olympic swimming pools" for volume and "libraries of congress" for data capacity ;)

Re: Show HN: I created Units Converter that contains 5000 units across 78 categories

#33
post #27

People interested in this should check out Frink. It has been around for a while and has thousands of unit conversions with explanations, as well as a web interface for the unit conversions part https://frinklang.org/ https://frinklang.org/frinkdata/units.txt https://frinklang.org/fsp/frink.fsp

The units list is hilarious and amazingly detailed, a sample:

  crocodile :=           megavolt     // used informally in UK physics labs
  
  ...
  
  footcandle :=          lumen/ft^2   // Illuminance from a 1 candela source
                                      //    at a distance of one foot
  
  ...
  
  // In Britain, the deal is apparently any piece of wood over 6 feet long, over
  // 7 wide and 2.5 inches thick.  The OED doesn't give a standard size.  A piece
  // of wood less than 7 inches wide is called a "batten".  This unit is now used
  // exclusively for fir and pine.
 
  deal :=         12 ft 11 in 2.5 in // The standard North American deal [OED]
  wholedeal :=    1/2 deal           // If it's half as thick as the standard
                                     //   deal it's called a "whole deal"!
  splitdeal :=    1/2 wholedeal      // And half again as thick is a split deal.
  
  ...
  
  parasang :=            3.5 mile // Persian unit of length usually thought
                                  // to be between 3 and 3.5 miles

Re: Show HN: I created Units Converter that contains 5000 units across 78 categories

#34
I didnt look but http://unitsofmeasure.org which is part of the HL7 standard for electronic medical records might be an interesting source/reference

It has zillions of base units and a algebra syntax for definitions of many more

Edit: "common" units https://github.com/ucum-org/ucum/tree/main/common-units

Re: Show HN: I created Units Converter that contains 5000 units across 78 categories

#35
post #5

The first thing I looked for was football fields, but couldn't find it. :)

Also absent: Smoot's[0] :-) [0] https://en.wikipedia.org/wiki/Smoot

its already added under length category.

Re: Show HN: I created Units Converter that contains 5000 units across 78 categories

#36
post #29
post #5

The first thing I looked for was football fields, but couldn't find it. :)

And no Wales for areas :(

Thanks for letting me know. I will add it by tomorrow. I will check all units mentioned in the comments and add them one by one.

Re: Show HN: I created Units Converter that contains 5000 units across 78 categories

#37
post #14

Earlier quoted context omitted.

Funny, I would have looked in the length area, as that's how it's usually used. Part of the problem is that first you have to decide if it's 100 yards or 120 yards.

I just googled it after your comment and the conversion of football field came in terms of acre or hectare so I think Area is suitable. I will see what most people are using and based on that I will set its value.

I agree that it's most commonly an expression of area. I think the length alternative is valid but pretty rare by comparison.

Re: Show HN: I created Units Converter that contains 5000 units across 78 categories

#39
post #24

You could add GeV/c2 (giga-electronvolts per speed of light squared) as a unit of weight that is used by physicists for sub-atomic particle mass.

As an example of a completely different approach, this works out of the box in GNU units (showing both noninteractive and interactive usage):

  $ units GeV/c^2
          Definition: 1.7826619e-27 kg

  $ units
  Currency exchange rates from FloatRates (AUD base) on 2023-06-21
  3761 units, 113 prefixes, 120 nonlinear units

  You have: GeV/c^2
  You want: [leave it blank]
          Definition: 1.7826619e-27 kg
  You have: 
Because of these various definitions (a selection of lines pulled from /usr/share/units/definitions.units, I think I have included all the relevant ones recursively):

  G-                      giga
  giga-                   1e9      # Greek gigas, "giant"
  e         1.602176634e-19 C  # electron charge (exact)
  C                       coulomb
  coulomb                 A s          # charge
  A         !      # The ampere, symbol A, is the SI unit of electric current. […]
  s         !      # The second, symbol s, is the SI unit of time.  It is defined […]
  V                       volt
  volt                    W/A          # potential difference
  W                       watt
  watt                    J/s          # power
  J                       joule
  joule                   N m          # energy
  N                       newton
  newton                  kg m / s^2   # force
  kg        !      # The kilogram, symbol kg, is the SI unit of mass.  It is […]
  m         !      # The metre, symbol m, is the SI unit of length.  It is […]
  c         299792458 m/s   # speed of light in vacuum (exact)
(Fun thing, kg being the SI unit. Because of this, gram is defined as millikg!)

I really like the approach of specifying what you have, in absolutely whatever unit you like, and what you want (though I omitted that argument in this case, to just have it show the definition), and having it resolve it.

An excerpt from my ~/.units (which does have some serious stuff in it too, honest):

  # Why not? (Question: is the slightly-Welsh-sounding ygazillion, yocto-gazillion, 10⁻²⁴ gazillion, greater or less than one?)
  gazillion !

  elephant 6.35 tonne
  elephant_african 6.35 tonne
  elephant_asian 5 tonne
  # I want to have ranged values: elephant_baby 90–135 kg. This get complicated because of non-linear transformations, e.g. 2^(1–10) = 2–1024, but log₂-biased.
  # baby_grand is also a baby
Post reply on HN