Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

number formatting 1

Status
Not open for further replies.

swetham

Programmer
May 5, 2010
257
DE
I have data like

T12 .23
T13 .56
T14 .256
T15 .258
T16 .458

Now i need a formula like if T12,T13 comes in the column then the decimal value should be (.23 2 digits precision) and if T14,T15,T16 comes it should be of 3 digits precision.


Can anyone help?
 
In the customize style tab for format->number, go to decimals->x+2 and enter:

if {table.field} in ["N12","N13"] then
2 else
if {table.field} in ["N14","N15","N16"] then
3 else
2//or whatever your default is for other values

Also make sure that the rounding is set for at least 3 decimals.

-LB
 
Sorry i need to format the T12 field first as i need to check if 12,13 then 2 decimals else if 14,15,etc then 3 decimal. How to extract only 12 from T12?
 
Sorry, I meant to use "T" not "N". The format of the T field is irrelevant.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top