` Swedish rounding (Greg Bailey ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Swedish rounding
2005-03-24 -- Greg Bailey
 
> A fun fact about New Zealand: The monetary system revolves around Swedish > rounding. Back around 6 years ago when the switch to plastic money happened, > New Zealand got rid of the penny and instituted a crazy rounding scheme. > Here's how it goes: middle numbers (3, 4, 5, 6, and 7) all round to 5, and > end numbers (8, 9, 0, 1, and 2) round to 0. So something that's 3.97 rounds > to 3.95. Got it? Good, you're on your way to becoming Kiwi. I don't see how you can do it without examining each number. Something like this. NbrString string( 20 ) NbrString = format( Amount, n020.2 ) !force to fill string case NbrString[ 20 ] of 8 to 9 orof 1 to 2 NbrString[ 20 ] = 0 of 3 to 7 NbrString[ 20 ] = 5 end!case Amount = NbrString


Today is November 21, 2024, 7:39 am
This article has been viewed 35376 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: