realbasic-nug.de
[Top] [All Lists]

Re: Rundungsproblem

To: REALbasic-NUG German <realbasic-nug dot de at lists dot realsoftware dot com>
Subject: Re: Rundungsproblem
From: Andy Fuchs <andy at foxwerk dot de>
Date: Tue, 31 Jan 2006 11:03:38 +0100
Delivered-to: realbasic-nug dot de at lists dot realsoftware dot com
Thread-index: AcYmTZrp2WMOaZJAEdqS3gANky6ZpA==
Thread-topic: Rundungsproblem
Versuch's mal so:

Protected Function roundCh(myFloatValue as double) As double
   
   dim d as Double
   
   const factor=20.0
   
   d = myFloatValue*20.0
   return round(d)/20.0
   
End Function


Grüße

-- 
-- Andy Fuchs



> From: Stefan Sicurella <sicurella at onlymac dot de>
> Reply-To: REALbasic NUG German <realbasic-nug dot de at lists dot 
> realsoftware dot com>
> Date: Tue, 31 Jan 2006 10:37:59 +0100
> To: REALbasic NUG German <realbasic-nug dot de at lists dot realsoftware dot 
> com>
> Subject: Rundungsproblem
> 
> Hi,
> 
> ich möchte Beträge für die Schweiz runden, leider ist dort ja alles
> etwas anders als in Deutschland ;-)
> deshalb runden die Schweizer hinter dem Komma jeweils auf den 5er
> Rappen, also aus 12,17 wir 12,15 und aus 12,176 wird 12,20 bzw. aus
> 12,14 wird 12,15 und aus 12,124 wird 12,10
> 
> Es scheint mir weder mit Format noch mit round eine Möglichkeit zu
> geben das so zu runden?!?
> 
> Weiß jemand Rat?
> 
> Gruß
> 
> Stefan




<Prev in Thread] Current Thread [Next in Thread>