[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] Rounding to the next whole number
Hi Murali,
One way to do this is to change the number to a string, look for a decimal
point in the string, copy everything after the decimal to a number variable.
If it is greater than 0, it is non-whole. If it is equal to 0, whole.
begin-procedure check_for_whole_nbr ( #number_in, $whole )
move #number_in to $str_nbr
let #offset = instr($str_nbr, '.', 1)
let #length = length($str_nbr)
let $piece = substr($str_nbr, #offset, #len)
move $piece to #piece
if #piece > 0
$whole = 'false'
else
$whole = 'true'
end-if
end-procedure
If there is a simpler way to do this, I'd like to know. I don't remember a
function in SQR to do this.
Kyle
_________________________________________
Kyle J. Leonard
Consultant
1Answer Solutions
-----Original Message-----
From: sqr-users-bounces+kyle.leonard=1answersolutions.com@sqrug.org
[mailto:sqr-users-bounces+kyle.leonard=1answersolutions.com@sqrug.org] On
Behalf Of Kaithi, Murali
Sent: Thursday, January 05, 2006 12:54 PM
To: This list is for discussion about the SQR database reportinglanguage
fromHyperion Solutions.
Subject: RE: [sqr-users] Rounding to the next whole number
Sudheer,
Thanks for your reply,
I am not trying to print the result, after I divide the number, I just
want to investigate the result whether it is a whole number or not if
not get the next whole number.
How do I investigate the result number after dividing.
Thanks,
Murali
-----Original Message-----
From: sqr-users-bounces+murali.kaithi=spencergifts.com@sqrug.org
[mailto:sqr-users-bounces+murali.kaithi=spencergifts.com@sqrug.org] On
Behalf Of Sudheer Bachu
Sent: Thursday, January 05, 2006 1:41 PM
To: This list is for discussion about the SQR database reportinglanguage
fromHyperion Solutions.
Subject: RE: [sqr-users] Rounding to the next whole number
Hi murali,
You can divide the number with any number and id it is an
amount edit the number while printing like Your_final_print_variable =
edit(&calculated_number,'$$$,$$$,$$0' )
Else it is just a number then use this
PRINT $ Your_final_print_variable (0,+{col_sep},{col_amt}) edit 999
Thanks
Sudheer Bachu
-----Original Message-----
From: sqr-users-bounces+sbachu=creditacceptance.com@sqrug.org
[mailto:sqr-users-bounces+sbachu=creditacceptance.com@sqrug.org] On
Behalf Of Kaithi, Murali
Sent: Thursday, January 05, 2006 1:37 PM
To: This list is for discussion about the SQR database reporting
languagefromHyperion Solutions.
Subject: [sqr-users] Rounding to the next whole number
I have to divide a number by 10 and if the resulting number is not a
whole number, I have to Round up to the next whole number.
How can I accomplish this?
Appreciate your response.
Thanks,
Murali
________________________________________________________________________
This Email has been scanned for all viruses by PAETEC Email Scanning
Services, utilizing MessageLabs proprietary SkyScan infrastructure. For
more information on a proactive anti-virus service working around the
clock, around the globe, visit http://www.paetec.com.
________________________________________________________________________
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
________________________________________________________________________
This Email has been scanned for all viruses by PAETEC Email Scanning
Services, utilizing MessageLabs proprietary SkyScan infrastructure. For more
information on a proactive anti-virus service working around the clock,
around the globe, visit http://www.paetec.com.
________________________________________________________________________
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users