Sha256: 6f1177c15f3d6f59128078fd3b05328d28f2255014054957ef73f9d1eb1501ed
Contents?: true
Size: 454 Bytes
Versions: 149
Compression:
Stored size: 454 Bytes
Contents
CREATE OR REPLACE FUNCTION renalware.convert_to_float(v_input text) RETURNS FLOAT AS $$ DECLARE v_float_value FLOAT DEFAULT NULL; BEGIN -- return the value as a float or 0 if the value cannot be coerced into a float BEGIN v_float_value := v_input::FLOAT; EXCEPTION WHEN OTHERS THEN RAISE NOTICE 'Invalid float value: "%". Returning NULL.', v_input; RETURN 0; END; RETURN v_float_value; END; $$ LANGUAGE plpgsql;
Version data entries
149 entries across 149 versions & 1 rubygems