Home > database >  Best Django model field to store frequency (from Hz to 10 GHz)
Best Django model field to store frequency (from Hz to 10 GHz)

Time:08-30

What is the best model field to store a frequency, from 1 Hz to 10 GHz? IMHO could be a PositiveBigIntegerField but I'm not completely convinced...

Thank you

CodePudding user response:

If you only need integer hertzes, then go with PositiveBigIntegerField, nothing wrong with that.

If you (think you might) need non-integer values, you could store eg. millihertzes - or just go for a DecimalField and store hertz.

  • Related