When a right or estate of dower or curtesy is sold pursuant to section 2A:56-25 of this title, the court shall direct the payment of a gross sum out of the proceeds of the sale of the real estate to the person entitled to such right or estate if he or she shall consent in writing to accept such gross sum. If no such consent is given, the court shall calculate an amount to be invested for the benefit of the person entitled to such right or estate.
N.J.S. § 2A:56-26