kitspace / electro-grammar

:zap: A parser for electronic component descriptions
https://kitspace.github.io/electro-grammar/
MIT License
276 stars 13 forks source link

Cope with more ways of expressing units for parts values #20

Closed kevinb456 closed 5 years ago

kevinb456 commented 5 years ago

Few aspects noted which BOM builder and Electro grammer don't cope with;

end result being, should be able to cope with "16N8" and "16.8n" and other permutations.

Need to be careful, because some don't want to be case insensitive e.g. 'm' and 'M' are very different!

kasbah commented 5 years ago

Copying this over from another issue

Also cope with upper-case versions of the units (except for M/m), and 'MEG'. Full list:

  • M / MEG / meg / Meg for 10^6
  • k / K for 10^3
  • 'R' for resistors for 10^0
  • m for 10^-3
  • U / u / μ for 10^-6
  • N / n for 10^-9
  • P / p for 10^-12

Also saw "1n5F"

kasbah commented 5 years ago

Splitting this up / marking as duplicated for

And lastly trying to address leaving off the units in bom-builder rather than here: https://github.com/kitspace/bom-builder/issues/35