Arlen Beiler
Arlen Beiler

Reputation: 15866

VB.NET equivalent to excel's quotient function

Does VB.NET have a function to get the quotient like you can in excel.

Quotient(12, 6)

Upvotes: 0

Views: 1914

Answers (3)

Juliusz
Juliusz

Reputation: 2105

In a case when there is no VBA equivalent, you can always use WorksheetFunction, for example:

WorksheetFunction.Quotient(Arg1, Arg2)

Upvotes: 0

Matteo Italia
Matteo Italia

Reputation: 126787

Despite what I wrote in the comment, for both of them the integer division is performed with the same operator, i.e. \ (notice that it's not a regular slash, but a backslash).

5\2 => evaluates to an integer 2
5/2 => evaluates to a double 2.5

(notice that the return type here is for Integer operands, but it varies from the operands' type)

For more information on the VB.NET version of these operators see:

Upvotes: 4

ysap
ysap

Reputation: 8115

quotient = 12 \ 6 ' filler filler filler

Upvotes: 1

Related Questions