← Back to team overview

kicad-developers team mailing list archive

Re: StrNumCmp

 


Be careful with floating points: a separator can be a point or a comma, and you don't know what
separator was used when creating a string.
Never expect the separator is always a point or always a comma.
You can find a mix of these 2 notations.

And generally speaking, a point or a comma inside a string with digits is not necessary a fp separator.

As I said previously, StrNumCmp in mainly intended to sort references in list.
Most of time, for a component value, you cannot know the meaning of separator
You can have 4,7K or 4.7K or 4K7 but also 7400,DIP14
Hello!
When not specifying this Simon-Extended-Numbers-Mode, it should do what the original StrNumCmp function was intended to do. I only added that flag because Simon asked for generalization, it may well be that those two should better stay independent. That would of course simplify the parse_number function immensely ;)

Michael


References