There are 40 nickels in $2.
This is because a nickel is worth 5 cents, and there are 100 cents in a dollar. So, two dollars would be equal to 200 cents (2 x 100 cents/dollar). Dividing the total value in cents (200 cents) by the value of a nickel (5 cents/nickel) gives you the number of nickels:
200 cents / 5 cents/nickel = 40 nickels