V15: Hiding zeros at the end of numeric field's decimal.
Posted: Wed Feb 02, 2022 1:56 pm
Hi all,
If the last few digits in a numeric field is zero, I would like to hide that zero. And I would like to implement it with a numeric field, not a character field. I've tried a few editing options and it seems that decimal zeros are always visible.
I did the following test.
Field definition:
signed(15,5) edit option 2
Value setting:
#hl202042fld := 1
#hl202042fld := 1.2
#hl202042fld := 1.25
Execution screen:
I would like to display as shown below.
1.00000 →1
1.20000 →1.2
1.25000 →1.25
Does anyone know a good way?
Best regards,
Rieko Saitoh
If the last few digits in a numeric field is zero, I would like to hide that zero. And I would like to implement it with a numeric field, not a character field. I've tried a few editing options and it seems that decimal zeros are always visible.
I did the following test.
Field definition:
signed(15,5) edit option 2
Value setting:
#hl202042fld := 1
#hl202042fld := 1.2
#hl202042fld := 1.25
Code: Select all
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Clientwidth(247) Clientheight(190) Componentversion(2) Left(1224) Top(370) Layoutmanager(#Layout1)
Define_Com Class(#PRIM_TBLO) Name(#Layout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Layout1Row1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Layout1Column1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Item) Name(#Layout1Item1) Alignment(TopCenter) Column(#Layout1Column1) Manage(#Grid1) Parent(#Layout1) Row(#Layout1Row1)
Define_Com Class(#PRIM_GRID) Name(#Grid1) Captionnoblanklines(True) Columnscroll(False) Componentversion(1) Displayposition(1) Left(0) Parent(#COM_OWNER) Showselection(True) Showselectionhilight(False) Showsortarrow(True) Tabposition(1) Top(0) Height(190) Width(247) Rowheight(36) Columnbuttonheight(30)
Define_Com Class(#PRIM_GDCL) Name(#GridColumn1) Displayposition(1) Parent(#Grid1) Source(#hl202042fld) Width(92)
Evtroutine Handling(#com_owner.CreateInstance)
Set Com(#com_owner) Caption(*component_desc)
Endroutine
Evtroutine Handling(#COM_OWNER.Initialize) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Clr_List Named(#Grid1)
#hl202042fld := 1
Add_Entry To_List(#Grid1)
#hl202042fld := 1.2
Add_Entry To_List(#Grid1)
#hl202042fld := 1.25
Add_Entry To_List(#Grid1)
Endroutine
End_Com
I would like to display as shown below.
1.00000 →1
1.20000 →1.2
1.25000 →1.25
Does anyone know a good way?
Best regards,
Rieko Saitoh