ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó¨Ï¥Î¥¨¶°¦Û°Ê­pºâªÑ»ùº¦¶^°±»ù?

¤j¤jÀ³¸Ó¥ýÁ|¨Ò»¡¤@¤U
­þ¤@¤éªº­È­pºâ¦³¿ù»~
¦Ó¥¿½Tªº­ÈÀ³¸Ó¤S¬O¦h¤Ö

TOP

¤j¤j§Ú·Ó§A¤½¦¡Â½Ä¶¦Ó¤w

Public Function º¦¶^°±»ù(¬Q¦¬,  º¦or¶^ As Long)

º¦¶^°±»ù = ""
If ¬Q¦¬ = "" Then Exit Function

   Price_Sample = Array(0, 10, 50, 100, 500, 1000)
interval_Sample = Array(0.01, 0.05, 0.1, 0.5, 1, 5)

interval = Application.WorksheetFunction.Lookup(¬Q¦¬, Price_Sample, interval_Sample)

If º¦or¶^ > 0 Then º¦¶^°±»ù = Application.WorksheetFunction.Floor(¬Q¦¬ * 1.1, interval)
If º¦or¶^ < 0 Then º¦¶^°±»ù = Application.WorksheetFunction.Ceiling(¬Q¦¬ * 0.9, interval)

End Function

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2016-4-25 09:15 ½s¿è

¦^´_ 5# shuasa

§Ú¦³²z¸Ñ¿ù¼Ú     

À³¸Ó³o¼Ë¤~¹ï

Public Function º¦¶^°±»ù(¬Q¦¬,  º¦or¶^ As Long)

º¦¶^°±»ù = ""
If ¬Q¦¬ = "" Then Exit Function
if º¦or¶^ = 0 Then Exit Function

   Price_Sample = Array(0, 10, 50, 100, 500, 1000)
interval_Sample = Array(0.01, 0.05, 0.1, 0.5, 1, 5)

º¦¶^°±»ù = ¬Q¦¬ * ( 1 + sgn( º¦or¶^ )   )  * 0.1
interval = Application.WorksheetFunction.Lookup(º¦¶^°±»ù, Price_Sample, interval_Sample)

If º¦or¶^ > 0 Then º¦¶^°±»ù = Application.WorksheetFunction.Floor(º¦¶^°±»ù , interval)
If º¦or¶^ < 0 Then º¦¶^°±»ù = Application.WorksheetFunction.Ceiling(º¦¶^°±»ù , interval)

End Function

TOP

¶^°±¤@©w­n¥Î Ceiling ¤£¯à¥Î floor

TOP

¦^´_ 8# jackyq

«õ­ù°Ç !!!!  0.1 ©ñ¿ù¦ì¸m

¦A§ó¥¿¤@¦¸

Public Function º¦¶^°±»ù(¬Q¦¬,  º¦or¶^ As Long)

º¦¶^°±»ù = ""
If ¬Q¦¬ = "" Then Exit Function
if º¦or¶^ = 0 Then Exit Function

   Price_Sample = Array(0, 10, 50, 100, 500, 1000)
interval_Sample = Array(0.01, 0.05, 0.1, 0.5, 1, 5)

º¦¶^°±»ù = ¬Q¦¬ * ( 1 + sgn( º¦or¶^ )  * 0.1  )  
interval = Application.WorksheetFunction.Lookup(º¦¶^°±»ù, Price_Sample, interval_Sample)

If º¦or¶^ > 0 Then º¦¶^°±»ù = Application.WorksheetFunction.Floor(º¦¶^°±»ù , interval)
If º¦or¶^ < 0 Then º¦¶^°±»ù = Application.WorksheetFunction.Ceiling(º¦¶^°±»ù , interval)

End Function

TOP

        ÀR«ä¦Û¦b : ¶¢¤HµL¼Ö½ì¡A¦£¤HµL¬O«D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD