Bruce,

You might try using "GREATER THAN" and "LESS THAN" rather than BETWEEN.

Instead of:

(IFF('.v102_roundingTarget BETWEEN     0.01 AND      4.99

Try:

(IFF('.v102_roundingTarget > 0 AND v102_roundingTarget < 5

It may capture the decimals between 0.00 and 0.01, and the decimals between 
4.99 and 5.00

It's worth a test.

Steve Sweeney

________________________________
From: '[email protected]' via RBASE-L <[email protected]>
Sent: Sunday, July 26, 2026 1:37 PM
To: [email protected] <[email protected]>
Subject: [RBASE-L] - IFF statement fail

All:

RBG11 Current

For  charting wide ranges of values, I perform incremental rounding to simplify 
display and interpretation (e.g. who cares about $13,437.17 when $13,500 will 
do? ).

This is the first time I've attempted to dynamically round with a full-set of 
preset increments, using this IFF construct (expanded for clarity ):

 {Assign value-range incremental rounding values. }
  SET VAR v102_roundingValue = +
    (IFF('.v102_roundingTarget       =     0.00               ',  0.00, +
    (IFF('.v102_roundingTarget BETWEEN     0.01 AND      4.99 ',  0.25, +
    (IFF('.v102_roundingTarget BETWEEN     5.00 AND   1000.00 ',  5.00, +
    (IFF('.v102_roundingTarget BETWEEN  1001.00 AND  10000.00 ', 10.00, +
    (IFF('.v102_roundingTarget BETWEEN 10001.00 AND 100000.00 ', 25.00, 50.00 +
     )) )) )) )) ))

This works ... sort of. When the routine runs outside of TRACE mode, all 
increments except 50.00 are ignored. All v102_roundingTarget values are rounded 
by 50.00.

And the kicker is, when I step through the code with F10 in TRACE mode, the 
proper increments are applied.

Does anything look out of place here?

Thanks much! Bruce

Bruce A. Chitiea | SafeSectors, Inc.
1142 S Diamond Bar Blvd #442
Diamond Bar CA 91765-2203

[email protected]
(909) 238-9012


--
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]<mailto:[email protected]>.
To view this discussion visit 
https://groups.google.com/d/msgid/rbase-l/em0a19783d-ef4d-4a17-9087-5bf33046be8d%40safesectors.com<https://groups.google.com/d/msgid/rbase-l/em0a19783d-ef4d-4a17-9087-5bf33046be8d%40safesectors.com?utm_medium=email&utm_source=footer>.

-- 
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 visit 
https://groups.google.com/d/msgid/rbase-l/SJ2PR03MB7378312E8D3FDED64BEC7F4789CD2%40SJ2PR03MB7378.namprd03.prod.outlook.com.

Reply via email to