Solved

How to change unit and decimals by parameters?

  • 6 February 2020
  • 5 replies
  • 162 views

Userlevel 3

Hi everyone!

 

Is there a way to change if I want to show or not the unit and the number of decimals by parameter?

 

Example: 

 

My wish:

500     |     0.00%

 

Thanks.

icon

Best answer by mohansx 8 February 2020, 00:28

@mateusarakawa , at this point of time - widget options like show/hide units, number of decimal points etc. are applied to the entire table. Different values for different contents in the table is not possible. There are plans to change this in a future version. 

One workaround could be to use an intermediate string parameter - formatting the values and units as you want it to be displayed.

View original

5 replies

Thank you @gabiservidone for asking. Can I check with you, are you aware of this feature https://documentation.aimms.com/webui/widget-options.html#number-of-decimals ? You can pass an AIMMS identifier to dynamically adjust the number of decimals or use the static value directly.

Userlevel 5

Hi @laithshadeed .

Thanks, we already checked that! However, both “number of decimals” and “show units” fields only allow a binary parameter or static values (1/0) that would apply the format to all contents within the widget.


In our use case, we have a table with different contents, thus we wanted to be able to show unit for parameter 0 % and do not show for parameter 500 ton. Is this possible?

 

FYI, we tried to create a binary parameter indexed in IndexIdentifers (P_ShowUnits(IndexIdentifiers)) to set “1” for content [%] and “0” for content [ton], but the fields “show units” and “number of decimals” didn’t allow us to use this binary parameter there.

Userlevel 5

@mateusarakawa , at this point of time - widget options like show/hide units, number of decimal points etc. are applied to the entire table. Different values for different contents in the table is not possible. There are plans to change this in a future version. 

One workaround could be to use an intermediate string parameter - formatting the values and units as you want it to be displayed.

Userlevel 6

One of the items we are currently working on is to adjust the way Widgets are setup structurally (backend) - this is required to be able to support this. Once done, it will allow a more fine grained control of eg setting properties per identifier next to ‘just’ the complete widget level properties. Think of decimals, units, etc. Idea is that under normal conditions the properties declared on widget level holds unless the identifier has a specified one.
 

Example: widget level decimals is 0 so all identifiers show 0 decimals except for IdentifierX, who shows 2 decimals.

 

Please expect an update on this in the next months to come either via the PO update or this Community. Do share with ‘identifier’ properties you like to have control over independently of other identifiers as this is great input to have!

Userlevel 3

Thanks @Gertjan  and @mohansx for the update. Changing to string parameters seems to solve the problem, but I will probably wait for this new development. And for now, we thought that the following may help. 

  • Hide/unhide;
  • Letter coloring;
  • Background coloring;
  • Units;
  • Decimals;
  • Column width.

Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator