cancel
Showing results for 
Search instead for 
Did you mean: 

How to format model attributes

Former Member
0 Kudos

I have staffNumber attribute as model attribute which is of type IntegerObject(not premitive int) . In inputTextbox it appears as 3,172 instead of 3172 . How to format Integer object values so that I can display values without comma . I know that , we can create a simple type in dictionary , select format for premitive integer type in representation . However I don't want to do that .

Pl help

Bhat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You cannot change the type of model attribute. What you can do instead is to use supply function.

Inside use toString method of Integer class and convert it into String.

Hope it helps.

thanks & regards,

Manoj

Former Member
0 Kudos

Hi Manoj,

I need to do this at 100 places . Hence I would like to know where this formatting option of types for whole WDframe work is stored so that I can change this option globally .

NPB

Former Member
0 Kudos

I was fed-up and ultimately had to use this code at every integer attribute of model nodes

wdContext.nodeXXX.getNodeInfo().getAttribute("eoStaffno").getModifiableSimpleType().setFormat("##########");

I wanted a global function to change locale settings

like if I do

NumberFormat nf = NumberFormat.getInstance(Locale.getDefault());

nf.setGroupingUsed(false);

Answers (0)