Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for comma in decimal point convention #17

Open
kasbah opened this issue Aug 30, 2018 · 1 comment
Open

Support for comma in decimal point convention #17

kasbah opened this issue Aug 30, 2018 · 1 comment

Comments

@kasbah
Copy link
Member

kasbah commented Aug 30, 2018

0.1uF versus 0,1uF. I know in Germany people will write 0,1uF

The problem comes down to queries like:

0,1uf 10% 0402 50v x7r

vs

0.01uf, 50v, cog, 5%, 0603

Also, are there any other decimal point or other locale conventions we are not aware of?

@kasbah kasbah changed the title Support for comman decimal point convention Support for comma in decimal point convention Aug 30, 2018
@kitspace kitspace deleted a comment from patcon Jul 31, 2019
@set-soft
Copy link

Just a note about it: In KiBot I handle it this way:

  • Check if the locale defines a decimal point that isn't .
  • If this is the case I just replace the decimal point by .

But the 0.01uf, 50v, cog, 5%, 0603 case is tricky, because it isn't using the decimal point of the locale, and uses it as separator. So I changed my code to replace the locale decimal point only when in the middle of a number. In Python is like this:

    if decimal_point:
        component = re.sub(r'(\d)'+decimal_point+r'(\d)', r'\1.\2', component)

This is all outside the parser, as a pre-processor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants