Post Reply 
Removing tag after units conversion
04-06-2015, 07:02 PM
Post: #1
Removing tag after units conversion
Does anyone know if there is a way to remove the units tag at the end of the number after converting from one unit to another. Example: 4.1244_in to 4.1244. I know I
can simply pull the number from the stack and edit out the tag, but I was hoping there might be a quicker, more convenient way of doing this.
Find all posts by this user
Quote this message in a reply
04-06-2015, 07:49 PM
Post: #2
RE: Removing tag after units conversion
You could just divide by one unit:

12_in/1_in ==> 12
Find all posts by this user
Quote this message in a reply
04-06-2015, 10:21 PM
Post: #3
RE: Removing tag after units conversion
(04-06-2015 07:49 PM)DrD Wrote:  You could just divide by one unit:

12_in/1_in ==> 12

That works. Thanks.
Find all posts by this user
Quote this message in a reply
04-07-2015, 02:14 AM
Post: #4
RE: Removing tag after units conversion
(04-06-2015 07:49 PM)DrD Wrote:  You could just divide by one unit:

12_in/1_in ==> 12

CAS.left(unit) is more cryptic but it also works, e.g. CAS.left(12_in) returns 12. One benefit of this method is that you don't need to know the unit; it strips off ANY unit or combination of units.

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
04-07-2015, 09:10 PM
Post: #5
RE: Removing tag after units conversion
(04-07-2015 02:14 AM)Joe Horn Wrote:  
(04-06-2015 07:49 PM)DrD Wrote:  You could just divide by one unit:

12_in/1_in ==> 12

CAS.left(unit) is more cryptic but it also works, e.g. CAS.left(12_in) returns 12. One benefit of this method is that you don't need to know the unit; it strips off ANY unit or combination of units.
Good solution Joe. I used the CAS method in my DTAG function for removing the units tag from the numerical result of a conversion on the 1st level stack.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)