اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

دالة RoundUp


أبو هادي

الردود الموصى بها

السلام عليك

دالة Round في الأكسس بها بعض المشكلات لفقدها جزء من دقة الأرقام المطلوب تقريبها مما يؤثر على نتائج تقريبها وقد عملت الدالة التالية لتحل محل الدالة الأصل وهي تعمل تماما كما الأصل ، آمل أن ينتفع بها .

Function RoundUp(ByVal Expression, _
        Optional ByVal NumDecimalPlaces = 0) As Double
  Dim Rnd
  
  On Error Resume Next
  
  If NumDecimalPlaces < 0 Then NumDecimalPlaces = 0
  If NumDecimalPlaces > 22 Then NumDecimalPlaces = 22
  
  Rnd = 0
  If Expression <> 0 Then
    Rnd = Val("0." & String(NumDecimalPlaces + 1, "0") & "1")
  End If
  
  RoundUp = Round(Expression + IIf(Expression > 0, Rnd, -Rnd), _
                  NumDecimalPlaces)
End Function

تحياتي .

تم تعديل بواسطه أبو هادي
رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information