SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Decimal rounding

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Decimal rounding
Author Message
Steve



Joined: 25 Jun 2002
Posts: 8

Post Decimal rounding Reply with quote

Is there an easy way to specify the number of digits in a number variable? The Round function does not work, as it applies only to division, and the Truncate function, though in the documentation, is not recognized within the JAL editor. I am able to achive my goal of two digits (e.g., 45.30, or 33.00) by stripping the variable at the decimal using InStr, Left, and Right, but this adds quite a few extra variables that are unnecessary if the Round or Truncate functions would work like they are documented in Chapter 19, Numeric Functions. Any help would be appreciated.

Tue Sep 13, 2005 3:09 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7963

Post Re: Decimal rounding Reply with quote

Truncate is not supported in JAL. It is only available in database filter expressions as a build-in method.

What you need to do is to convert number to a string then cut away extra digits and then convert it back to a number.

For example,

Dim str, string
Dim num, number, 125.3456

Format num, "000000.00", str
Set str, num

: Is there an easy way to specify the number of digits in a number variable?
: The Round function does not work, as it applies only to division, and the
: Truncate function, though in the documentation, is not recognized within
: the JAL editor. I am able to achive my goal of two digits (e.g., 45.30, or
: 33.00) by stripping the variable at the decimal using InStr, Left, and
: Right, but this adds quite a few extra variables that are unnecessary if
: the Round or Truncate functions would work like they are documented in
: Chapter 19, Numeric Functions. Any help would be appreciated.

Tue Sep 13, 2005 5:20 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.