Milligrams are used to measure the mass of something not the volume.
For the sake of argument, let us assume that the liquid that you are talking about has the same density as water. This would mean that the 40 milligrams that you propose would also measure out to 40 milliliters of volume.
Chat with our AI personalities