Merci d'avance
milka


[optional] Number indicating how many places to the right of the decimal are included in the rounding. If omitted, Round returns an integer.

il te faudra ecrire une fonction je crois car au niveau des math arrondire te donnera la valeur la plus presNemo85 a écrit :Bonjour,
oui très pratique cette fonction, mais est-ce possible de forcer en l'arrondi supérieure ex : 694.574 doit devenir 694.58
Merci, bàv
Nemo
Je ne capte pas bien ton code, il fait pareil que round : 694.574 => 694.57 et 694.575 => 694.58Nemo85 a écrit : 694.574 doit devenir 694.58
Code : Tout sélectionner
MsgBox(0,"",ArrondiSup(InputBox("","Nombre a virgule")))
Func ArrondiSup($arg)
Local $2E=False,$Float="",$Entier=""
If $arg=0 Then
MsgBox(0,"","0 / 0 = Tete a toto !!")
Return
ElseIf Round($arg)/$arg=1 Then
MsgBox(0,"","Ce n est pas un Nombre a virgule")
Return
EndIf
$arg=StringToBinary($arg)
For $x=3 to StringLen($arg) step 2
If $2E Then $Float &=StringMid($arg,$x,2)
If Not $2E And StringMid($arg,$x,2)<>"2E" Then $Entier &=StringMid($arg,$x,2)
If StringMid($arg,$x,2)="2E" Then $2E=True
Next
If StringLen($Float)=2 Then
Return Ceiling(BinaryToString("0x" &$Entier& "2E31"))
Else
$Modif=BinaryToString("0x" &$Entier) & "." & Ceiling(BinaryToString("0x"& StringLeft($Float,StringLen($Float)-2) & "2E" & StringRight($Float,2)))
Return $Modif
EndIf
EndFunc

Code : Tout sélectionner
Func decimalsup($nombre, $decimal)
Return Ceiling($nombre*10^$decimal)/10^$decimal
EndFunc