Decimal values in Numberfield? | Community
Skip to main content
eric_estes
New Participant
December 9, 2015
Solved

Decimal values in Numberfield?

  • December 9, 2015
  • 5 replies
  • 3600 views

I'm trying to use a Coral Numberfield, but it marks a decimal value as invalid and there doesn't seem to be any option to allow it. Is there something I'm missing?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

Hi 

You can use TypeHints for the same. Add a hidden field (xtype:hidden) with name = <numberField'sName>@TypeHint and value= Long (http://stackoverflow.com/questions/28467498/save-cq-component-field-value-as-long-instead-of-string).

Also please have at article mentioned by "Leeasling" :- http://blogs.adobe.com/livecycle/2011/12/beyond-string-typehint-to-rescue.html

I hope this would act as some help to you.

Thanks and Regards

Kautuk Sahni

5 replies

kautuk_sahni
kautuk_sahniAccepted solution
Employee
December 10, 2015

Hi 

You can use TypeHints for the same. Add a hidden field (xtype:hidden) with name = <numberField'sName>@TypeHint and value= Long (http://stackoverflow.com/questions/28467498/save-cq-component-field-value-as-long-instead-of-string).

Also please have at article mentioned by "Leeasling" :- http://blogs.adobe.com/livecycle/2011/12/beyond-string-typehint-to-rescue.html

I hope this would act as some help to you.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
smacdonald2008
New Participant
December 9, 2015
Have you tried to write a custom type that let's you use decimal values. I am thinking there may be a way to write custom script to solve this. 
eric_estes
New Participant
December 9, 2015

Yup, that's it. The old numberfield has a bunch of options but they don't seem to carry over to the new one.

New Participant
December 9, 2015
smacdonald2008
New Participant
December 9, 2015