Indigo Rose Software
  #1  
Old 09-26-2003
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
Grin Rounding a Number Up or Down

Rounding a Number Up or Down

Rounding a Number Up or Down

Document ID: IR10018
The information in this article applies to:
  • AutoPlay Media Studio 5.0 Professional Edition

SUMMARY

This article describes how to round numbers up or down using the built in math functions.

DISCUSSION

If you want all fractions to round up (e.g. 2.1 -> 3.0, 2.5 -> 3.0) then use Math.Ceil:

whole_number = Math.Ceil(decimal_number);

If you want all fractions to round down (e.g. 2.1 -> 2.0, 2.5 -> 2.0) then use Math.Floor.

whole_number = Math.Floor(decimal_number);

If you want anything equal to or above ".5" to round up, and anything below ".5" to round down (e.g. 2.1 -> 2.0, 2.5 -> 3.0), use the following calculation:

n = 2.5;
rounded = Math.Floor(n + 0.5);

MORE INFORMATION

For more information please see the following topics in the AutoPlay Media Studio 5.0 help file:

  • Program Reference | Actions | Math | Math.Ceil
  • Program Reference | Actions | Math | Math.Floor

KEYWORDS: AutoPlay Media Studio 5.0, Actions, Math, Round, Whole, Number, Floor, Ceiling


Last reviewed: September 26, 2003
Copyright © 2003 Indigo Rose Corporation. All rights reserved.
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On



All times are GMT -6. The time now is 06:42 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software