Decimal type field does not show decimal value.

Vaishnavi35
Tera Guru

Hi,

I have a decimal field Payback period but it does not show decimal value.

find_real_file.png

19350/252 = 77.4 but it shows only 77.

Client script for that is,

find_real_file.png

Thanks,

Vaishnavi

1 ACCEPTED SOLUTION

script i have tested on my personal instance and worked. 

function onSubmit() {
	//Type appropriate comment here, and begin script below
	var currency_amount = g_form.getIntValue('total_costs');

	var currency_code = g_form.getIntValue('score');

	g_form.setValue('u_mytest', currency_code/currency_amount);
}

 

u_mytest was initially as "integer" type . and i had more than 20 record which was holdig the value, i just deleted and changed the type and then applied onSubmit client script to set the value and its setting as decimal. 

View solution in original post

29 REPLIES 29

It is not taking the value.

I have disabled the script and tried saving the value 25.4 it did not save 😞

What am i supposed to do now? Delete and create a new field?

do you have any existing script written ? like calculated field ? 

Ya... Is it because initially it was Integer and now I have changed to Decimal its not working?

find_real_file.png

changing the type would not be any issue. 

I validated this on my personal instance . 

Can you show me the field dictionary again. 

 

do one thing, open background script and run the script below. 

 

var gr = new GlideRecord('dmn_demand');

gr.get('add one record sys_id');

gr.<field name>=44.3;

gr.update();

run this and let me know the result.  

Hi Harsha,

Okay.

Dictionary,

find_real_file.png

The Background script run successfully. But it did not get updated. 😞