fend icon indicating copy to clipboard operation
fend copied to clipboard

Collision between fahrenheit (temperature) and farad (capacitance) suffixes

Open khrs opened this issue 3 years ago • 5 comments

The "F" suffix is used 2 times. Once for fahrenheit and once for farad.

Also the "C" suffix is used two times. Once for celsius and once for coulomb this lead to funny units like

!debug 1 micro farad 1/1000000 farad (= 1 ampere celsius kilogram^-1 meter^-2 second^3) (base 10, auto, simplifiable)

khrs avatar Jun 29 '21 07:06 khrs

I recommend using instead of "F" -> "oF" for fahrenheit and instead of "C" -> "oC" for celsius. The same way as libqalculate handle it.

khrs avatar Jun 29 '21 07:06 khrs

Hmm that's unfortunate, thanks for noticing and submitting a PR. I'll have to have a bit more of a think, but I'll try and fix this issue soon (potentially with your PR, or using a slightly different approach).

printfn avatar Jun 29 '21 07:06 printfn

Please keep in mind that F (farad) and C (coulomb) are official SI symbols for this units. I think is probably bad idea to redefine it.

khrs avatar Jun 29 '21 07:06 khrs

I've released fend v0.1.20, which includes a bunch of changes relating to this:

  • Fixed the definition of farad to always refer to coulomb
  • Added aliases oC and oF as suggested
  • Added a config option to the CLI to change C and F as suggested (see https://github.com/printfn/fend/wiki#configuration)

The default configuration still defines C as °C, but if you change the configuration option then the command-line UI will instead define C as coulomb (and similarly for F). I've decided against changing the default at this stage because too many users already rely on the existing behaviour, and because temperature conversions are generally more common than coulomb/farad conversions.

In the future I plan to make combined units like µF and nF work by default, and to potentially automatically pick the correct unit when doing conversions with to.

printfn avatar Jun 29 '21 12:06 printfn

Super. Thanks.

khrs avatar Jun 29 '21 12:06 khrs