We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

How to allow decimal values in integer field

Siri8
Kilo Contributor

In a Integer type field it should allow decimal values as well.I have followed below script but it is not accepting decimal values

Client Script : onChange

function onChange(control, oldValue, newValue, isLoading, isTemplate)

{

if (isLoading || newValue === '')

{
return;
}
var reg = /^[0-9]*\.[0-9]{2}$/;
var ans = g_form.getValue('field_name');
if(!reg.test(ans))
{
g_form.clearValue('field_name');
}
}

5 REPLIES 5

Hi all,

 

how to convert decimal to number ?

 

 

thanks niranjan