A formula creator function for js.