The value of securities held by creditors shall be determined in such manner as the court shall approve, and such value shall be credited upon the claims so secured and the balance only allowed, unless the creditor shall surrender the security, in which case he may be allowed his whole claim.