Day 003: SGN
#13
That's a good one, too.

It would otherwise take...

Code: (Select All)
FUNCTION roundDP$ (num, digits) ' fixed with sgn 2022-11-08
    DIM s$, dot
    SELECT CASE num
        CASE IS < 0
            s$ = _TRIM$(STR$(num - .5 * 10 ^ -digits))
        CASE 0
            s$ = _TRIM$(STR$(num * 10 ^ -digits))
        CASE IS > 0
            s$ = _TRIM$(STR$(num + .5 * 10 ^ -digits))
    END SELECT
    dot = INSTR(s$, ".")
    IF dot THEN roundDP$ = MID$(s$, 1, dot + digits) ELSE roundDP$ = s$
END FUNCTION

Pete
Reply


Messages In This Thread
Day 003: SGN - by SMcNeill - 11-08-2022, 12:34 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 01:39 PM
RE: Day 003: SGN - by SMcNeill - 11-08-2022, 02:29 PM
RE: Day 003: SGN - by Jack - 11-08-2022, 02:28 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 03:13 PM
RE: Day 003: SGN - by SMcNeill - 11-08-2022, 03:50 PM
RE: Day 003: SGN - by Jack - 11-08-2022, 03:43 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 04:11 PM
RE: Day 003: SGN - by SMcNeill - 11-08-2022, 05:47 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 05:57 PM
RE: Day 003: SGN - by mnrvovrfc - 11-08-2022, 04:51 PM
RE: Day 003: SGN - by bplus - 11-08-2022, 08:20 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 08:28 PM
RE: Day 003: SGN - by bplus - 11-08-2022, 09:37 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 09:43 PM
RE: Day 003: SGN - by bplus - 11-08-2022, 09:53 PM
RE: Day 003: SGN - by Pete - 11-08-2022, 10:23 PM
RE: Day 003: SGN - by OldMoses - 11-09-2022, 07:18 AM
RE: Day 003: SGN - by Pete - 11-09-2022, 08:46 AM



Users browsing this thread: 7 Guest(s)