Solved

crystal Int function not working

Posted on 2008-10-07
4
610 Views
Last Modified: 2013-11-15
I created a function.  Inside I have two value. 1080.00  and  1062.00
I substract them; I display them using the int function. Still I get back a non-integer value: 18.00
I know it is pretty straght forward and very simple, but ... here I am asking
Any idea? anyone?
Thanks
All The Best

Yossele

Code:
--------------------------------------------
Local NumberVar MyStart := 1062.00;
Local NumberVar MyEnd   := 1080.00;
int (MyEnd - MyStart);
--------------------------------------------
 the result is  18.00  ( instead of  18 )
0
Comment
Question by:Yossele
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 45

Accepted Solution

by:
Kent Olsen earned 30 total points
ID: 22662289
Hi Yossele,

The int function doesn't control the display of a value.  It merely drops the fractional part of the value.

Rt-click on the field and select format -> number -> custom style.  Select "0" in the decimals field.


Kent
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 20 total points
ID: 22662861
Agree.

mlmcc
0
 

Author Closing Comment

by:Yossele
ID: 31503950
Thank you for such a prompt response.
Sometimes a simple answer will catapulte you toward a different search path where you find the solution.
Amaizing DIVINITY

Thanks
All The Best

Yossele
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22664278
Yossele -  You really should have given all the points and the compliment to KDO.

KDO - Grading Comments:
Thank you for such a prompt response.
Sometimes a simple answer will catapulte you toward a different search path where you find the solution.
Amaizing DIVINITY

Thanks
All The Best

Yossele

I will reopen the question if you wish so you can grade it appropriately.

mlmcc
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Monitor SQL Insert 8 121
Table locked in super exclusive after a failed REORG, how to exit ? 40 85
Crystal Report sorting 6 33
Supress a section of a field 6 39
1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question