Login

Tag "feet"

Snippet List

Feet and Inches FormField/Widget

Feet and Inches Widget/Field allows users to enter a value in feet, inches and fractional inches and have that value stored as a decimal in your database of choice. I have this code broken out into separate files, but you can always combine to suit your needs. I have designated file delineation with a single line comment and the name of the file as referenced in the import statements. The INCH_DECIMALS and INCH_FRACTION constants may be modified to allow smaller increments. My needs for this implementation only required accuracy to 1/16. Hope this helps someone learn how to use the MultiWidget and MultiValueFields! Happy Coding.

  • widget
  • multiwidget
  • multifield
  • feet
  • inches
Read More

1 snippet posted so far.