Forum

Thread tagged as: Question

Period Field Type...

Is there a way to allow this field to accept decimal amounts? ie 1.5 (hours)? When I try, I get a message that says it's valid value... and to enter either 1 or 2.

Thanks, Monty

Monty Lewis

Monty Lewis 2 points

  • 4 years ago

You likely need to use a text field for decimals.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm not familiar with a specific period field type, but if you use number you can set the step to 0.1

Sorry, I mean this function: https://docs.grabaperch.com/templates/field-types/period/

<perch:content id="duration" type="period" label="Duration" />
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. I don't have any recollection of that at all.

It needs to be a whole unit of time. If you need a smaller value, drop down to the smaller unit. 1.5 hours is 90 minutes.

One of Perch's hidden features :)

ok, cool. I think I'll switch to Numeric and force a unit on them. Thanks!