cancel
Showing results for 
Search instead for 
Did you mean: 

validation for decimal point

Former Member
0 Kudos

Hi

I have a label with name amount and atext box,according my scenario when user enter any values that decimal values should round up to 2 decimal places. for example if user enters 15.6777 its should round up as15.68.can please tell me the required code for this.

Thanks

Raju

Edited by: raju on Oct 1, 2008 1:36 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

please try this.


IWDAttributeInfo attrInfo = wdContext.node<yourNode>().getNodeInfo().getAttribute(nameOfYourValue);
attrInfo.getModifiableSimpleType().setFormat("###,###,##0.00");

This set the format of your value attribute to the following example 123,234.12

for a value like 123234.1234

regards

G.Werner

former_member185029
Active Contributor
0 Kudos

Raju,

Just create a simple type for that.

-Ashutosh

Former Member
0 Kudos

Hi

thanks for your reply asutosh, can to please tell me th eprocess how to create simple type for rouding up 2 decimal points

Thanks

Raju