Expand my Community achievements bar.

SOLVED

Decimal value with number field failing for specific value

Avatar

Level 2

Hi Team,

 

In my cq:dialog I have a field with following details:

<answerScore jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
fieldDescription="Select Score value for this Answer."
fieldLabel="Answer Score" name="./answerScore"
required="{Boolean}true"
min="{Double}-1"
max="{Double}10"
step="{Double}0.0001"/>

 It works fine for most of the values but fails for value 2.05. Is there anything I am doing wrong?

Thanks in advance!!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@Volga_Dharam_Rakshika 

Even I see issue using granite/ui/components/coral/foundation/form/numberfield, working as expected using  granite/ui/components/foundation/form/numberfield. Give a try.

View solution in original post

9 Replies

Avatar

Level 9

the step attribute is type of string not double. can you check that https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/granite-ui...

Hi @Pawan-Gupta , I have tried with String type as well. Same issue exists.

Avatar

Community Advisor

Hi, @Volga_Dharam_Rakshika,

 

The step should be a string as per the granite numberfield resource type.

step="{String}0.0001"

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/granite-ui...

i have tried with this and same issue for 2.05 value

Avatar

Community Advisor

Hi @Volga_Dharam_Rakshika 

You can use the step as "any" of type String and it will resolve the issue.
https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui...

 

Hope this helps!
Thanks!

Hi @Asutosh_Jena_, with using any I don't have control over any decimal places which is basically my requirement.

Avatar

Community Advisor

@Volga_Dharam_Rakshika 
That's an issue with the coral 3 number field. So you might need to go with granite number field for now to resolve the issue.

granite/ui/components/foundation/form/numberfield

 

Thanks!

Avatar

Correct answer by
Community Advisor

@Volga_Dharam_Rakshika 

Even I see issue using granite/ui/components/coral/foundation/form/numberfield, working as expected using  granite/ui/components/foundation/form/numberfield. Give a try.

@Anudeep_Garnepudi this works but the error message is quite difficult to read in case of error, any help on that?