Jim:  That's a nice combination of my and Doug's code!  There's two things that 
I use the MOD function for.  One is for this, to see if there's decimals.
The other time I use it is during declare cursors when I want to show a Pause 
of the process including information but don't want to show the pause for every 
row or use the Meter function.  If I want to display a pause every 20 records, 
I would do this:

SELECT COUNT(DISTINCT wk_wip) INTO vTotCount FROM tmpJobs

-- within the cursor:  SETVAR vLoop = (.vLoop + 1)
  SET VAR vMod  = (MOD(.vLoop,20))
  IF vLoop = 1 OR vMod = 0 THEN
    SET VAR vText = ('Calculating mid 50%:' & CTXT(.vLoop) & 'of' & 
CTXT(.vTotCount))
    PAUSE 4 USING .vText
  ENDIF


Karen
 
 
 
-----Original Message-----
From: Jim Belisle <[email protected]>
To: [email protected] <[email protected]>
Sent: Tue, Mar 17, 2020 10:07 am
Subject: RE: [RBASE-L] - capture just the decimal

#yiv3550030919 #yiv3550030919 -- _filtered {} _filtered {} _filtered {} 
_filtered {} _filtered {} #yiv3550030919 #yiv3550030919 
p.yiv3550030919MsoNormal, #yiv3550030919 li.yiv3550030919MsoNormal, 
#yiv3550030919 div.yiv3550030919MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:11.0pt;} #yiv3550030919 a:link, 
#yiv3550030919 span.yiv3550030919MsoHyperlink 
{color:blue;text-decoration:underline;} #yiv3550030919 a:visited, 
#yiv3550030919 span.yiv3550030919MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;} #yiv3550030919 p 
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:New;} 
#yiv3550030919 p.yiv3550030919MsoAcetate, #yiv3550030919 
li.yiv3550030919MsoAcetate, #yiv3550030919 div.yiv3550030919MsoAcetate 
{margin:0in;margin-bottom:.0001pt;font-size:8.0pt;} #yiv3550030919 
p.yiv3550030919MsoListParagraph, #yiv3550030919 
li.yiv3550030919MsoListParagraph, #yiv3550030919 
div.yiv3550030919MsoListParagraph 
{margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;font-size:11.0pt;}
 #yiv3550030919 span.yiv3550030919BalloonTextChar {} #yiv3550030919 
span.yiv3550030919EmailStyle20 
{font-family:New;color:windowtext;font-weight:normal;font-style:normal;} 
#yiv3550030919 span.yiv3550030919EmailStyle21 
{font-family:New;color:#1F497D;font-weight:normal;font-style:normal;} 
#yiv3550030919 .yiv3550030919MsoChpDefault {font-size:10.0pt;} _filtered {} 
#yiv3550030919 div.yiv3550030919WordSection1 {} #yiv3550030919 _filtered {} 
_filtered {} #yiv3550030919 ol {margin-bottom:0in;} #yiv3550030919 ul 
{margin-bottom:0in;} #yiv3550030919 Thanks for the guidance. I believe this 
will work. I tested it using a variety of numbers and came up with the 
information I need. This cares for whole numbers, numbers greater than one with 
a decimal and those with just a decimal. That is exactly what I needed. I knew 
it was something that needed a combination of functions.     NOTE: The vtcpc is 
the text number received from a DIALOG    SET VAR vcpc NUMERIC(9,2) = .vtcpc IF 
vcpc > 1 THEN   SET VAR vmcpc DOUBLE = (MOD(.vcpc,1))   IF vmcpc = 0 THEN     
SET VAR vrcpc REAL = .vcpc   ELSE     SET VAR vrcpc REAL = (.vcpc - 
(AINT(.vcpc)))   ENDIF ELSE   SET VAR vrcpc REAL = .vcpc ENDIF RETURN    Karen. 
I had never seen the MOD function. Thanks.    James Belisle    Making 
Information Systems People Friendly Since 1990     From: 
[email protected] [mailto:[email protected]]On Behalf Of Doug 
Hamilton
Sent: Tuesday, March 17, 2020 9:41 AM
To: R:Base List
Subject: Re: [RBASE-L] - capture just the decimal    SET VAR vNumReal REAL = 
3.14159

SET VAR vNumDecimal REAL = (.vNumReal - (AINT(.vNumReal)))

SHOW VAR vNum%

RETURN

Doug On 3/17/2020 9:03 AM, Jim Belisle wrote: 
What is the function or combination of functions that will give me just to 
decimal portion of a numeric number? I want to use the decimal portion to 
determine my next action.   James Belisle   Making Information Systems People 
Friendly Since 1990    --
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
[email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/CH2PR02MB7047ED5091A4C04CE8BE2AF4A0F60%40CH2PR02MB7047.namprd02.prod.outlook.com.
 


 -- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/CH2PR02MB70472D1CA4EBF3FC05684EC3A0F60%40CH2PR02MB7047.namprd02.prod.outlook.com.

-- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/155292194.7119681.1584458567920%40mail.yahoo.com.

Reply via email to