Title: Numberbox format to 5 or 5.1 not 5.0 [SOLVED] Post by: dayaners on May 22, 2014, 06:27:30 AM Good day, I would use the number box to create student grades in high school, however the number rounds to integer. Need to be allowed to place or integer (5) when he put the precision 2 rounds (5.0) but I need to stay (5) or (5.2).
Could someone help me? sorry for my bad english. Code: {field:'ano1',title:'ANO 1',width:70,align:'center',editor:{type:'numberbox'}}, Title: Re: Numberbox format to 5 or 5.1 not 5.0 Post by: jarry on May 22, 2014, 07:55:16 AM The numberbox takes the 'precision' property that can be used to display the number precision after the decimal separator.
Code: {field:'ano1',title:'ANO 1',width:70,align:'center', Title: Re: Numberbox format to 5 or 5.1 not 5.0 Post by: dayaners on May 22, 2014, 08:04:18 AM when i put precision 1:
the value 5.1 stay 5 and when put 5.5 they go to 6... i need put 5.1 or 5.2 and 5 only Title: Re: Numberbox format to 5 or 5.1 not 5.0 Post by: jarry on May 22, 2014, 08:28:07 AM If you want to do some special conversions, you have to customize the 'formatter' and 'parser' functions. The code below achieves how to round a number downwards to the nearest integer.
Code: {field:'ano1',title:'ANO 1',width:70,align:'center', Title: Re: Numberbox format to 5 or 5.1 not 5.0 Post by: dayaners on May 22, 2014, 10:29:09 AM this is the default, I need it to stop rounding.
Title: Re: Numberbox format to 5 or 5.1 not 5.0 Post by: dayaners on May 22, 2014, 10:58:07 AM got :D thanks a lot!
Code: {field:'ano1',title:'ANO 1',width:70,align:'center',editor:{type:'numberbox',options:{ |