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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with Number formatting

Status
Not open for further replies.

tttggg

Technical User
Joined
May 24, 2007
Messages
61
Location
CA
I’m using the following formula hoping to get the last 4 digits of a number
Right (totext({tablefield}),4) But it gives me only the last digit.

Table field result
1.5,138 8.00
2.14,008 8.00
3.129 9.00

If my formula is wrong, can anyone help me with it.

I want the result to be 1 – 5138
2 – 4008
3 – 0129
I know that getting 0129 is another issue but don’t know how to get that too.
Any help with this is much appreciated

Working with CR 8.5 & DB2
 
I'm confused. Is the table field like this:

1.5,138 //or like this:
5,138

Did you just add the numbers 1,2,3 to sequence the field results? If so, you should be able to use this:

Right(totext({tablefield},"00000"),4) //where the number of zeros match the maximum # of digits in the field

-LB
 


I just add the numbers 1,2,3 to sequence the field results
The table field is 5,138
I understand where i was wrong

Thank you LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top