Integer | -32,768 to 32,767 |
Long (long integer) | -2,147,483,648 to 2,147,483,647 |
Single (single-precision floating-point) | -3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values |
Double (double-precision floating-point) | -1.79769313486232E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values |
Currency (scaled integer) | -922,337,203,685,477.5808 to 922,337,203,685,477.5807 |
Decimal | +/-79,228,162,514,264,337,593,543,950,335 with no decimal point; +/-7.9228162514264337593543950335 with 28 places to the right of the decimal; smallest non-zero number is +/-0.0000000000000000000000000001 |
Παράδειγμα:
Sub main() Dim x As Double Dim i As Integer x = 0 For i = 1 To 10000 x = x + 0.1 Next i MsgBox Str(x) ' Should be 1000 End Sub
Υπολογισμός | Συνάρτηση |
Calculate the future value of an annuity based on periodic, fixed payments and a fixed interest rate. | FV(rate, nper, pmt[, pv[, type]]) |
Calculate the depreciation of an asset for a specific time period using the double-declining balance method or some other method you specify. | DDB(cost, salvage, life, period[, factor]) |
Calculate the interest payment for a given period of an annuity based on periodic, fixed payments and a fixed interest rate. | IPmt(rate, per, nper, pv[, fv[, type]]) |
Calculate the internal rate of return for a series of periodic cash flows (payments and receipts). | IRR(values()[, guess]) |
Calculate the modified internal rate of return for a series of periodic cash flows (payments and receipts). | MIRR(values(), finance_rate, reinvest_rate) |
Calculate the number of periods for an annuity based on periodic, fixed payments and a fixed interest rate. | NPer(rate, pmt, pv[, fv[, type]]) |
Calculate the net present value of an investment based on a series of periodic cash flows (payments and receipts) and a discount rate. | NPV(rate, values()) |
Calculate the payment for an annuity based on periodic, fixed payments and a fixed interest rate. | Pmt(rate, nper, pv[, fv[, type]]) |
Calculate the principal payment for a given period of an annuity based on periodic, fixed payments and a fixed interest rate. | PPmt(rate, per, nper, pv[, fv[, type]]) |
Calculate the present value of an annuity based on periodic, fixed payments to be paid in the future and a fixed interest rate. | PV(rate, nper, pmt[, fv[, type]]) |
Calculate the interest rate per period for an annuity. | Rate(nper, pmt, pv[, fv[, type[, guess]]]) |
Calculate the straight-line depreciation of an asset for a single period. | SLN(cost, salvage, life) |
Calculate the sum-of-years' digits depreciation of an asset for a specified period. | SYD(cost, salvage, life, period) |
Format(έκφραση[, εμφάνιση])όπου η "εμφάνιση" είναι μια συμβολοσειρά που καθορίζει θα μετατραπεί η αντίστοιχη έκφραση σύμφωνα με τους παρακάτω κανόνες:
Sub main() Dim x As Currency x = 1500000 MsgBox ("Κερδίσατε " + Format(x, "0,0.00 ""EUR""!")) End SubΕμφανίζει: