Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Truncating real number trailing zeros
Topic Summary:
Created On: 9-Mar-2005 20:37
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 9-Mar-2005 20:37
User is offline View Users Profile Print this message


Dan Dalton

Posts: 4
Joined: 19-Jan-2004

I was curious if there was any easy way to truncate the trailing zeros which exist when placing real numbers into a field (i.e. - I'd like: 1.0, I get: 1.000000). I'm sure there's a way to write my own DXL, but I'd like to not do that if possible.

thanks,
Dan
Report this to a Moderator Report this to a Moderator
 10-Mar-2005 08:18
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

From Jeremy's kitchen!

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 3-Nov-2005 02:24
User is offline View Users Profile Print this message


Brenda Cornell

Posts: 29
Joined: 7-Jul-2005

I tried this but it didn't work. Do I need to replace 'places' with the name of my attribute??

-------------------------
Brenda Heiss Cornell
Report this to a Moderator Report this to a Moderator
 3-Nov-2005 09:39
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

It does work, but you need to be careful to use it correctly.
I didn't explain properly in the first post.

The function returns a string, not a real.
If the result is cast to a real by assigning to a DXL attribute of type real then the trailing zeroes will get added again.

The following works in a dxl attribute of type string:

-------------------------
Tony Goodman
http://www.smartdxl.com

Edited: 3-Nov-2005 at 09:41 by Tony Goodman
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.