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 <[EMAIL PROTECTED]>
> Reply-To: REALbasic NUG German <[email protected]>
> Date: Tue, 31 Jan 2006 10:37:59 +0100
> To: REALbasic NUG German <[email protected]>
> 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


Antwort per Email an