Revision 4789
Added by Aaron Marcuse-Kubitza about 12 years ago
functions.sql | ||
---|---|---|
73 | 73 |
|
74 | 74 |
|
75 | 75 |
-- |
76 |
-- Name: _frac_to_pct(double precision); Type: FUNCTION; Schema: functions; Owner: -
|
|
76 |
-- Name: _fraction_to_percent(double precision); Type: FUNCTION; Schema: functions; Owner: -
|
|
77 | 77 |
-- |
78 | 78 |
|
79 |
CREATE FUNCTION _frac_to_pct(value double precision) RETURNS double precision
|
|
79 |
CREATE FUNCTION _fraction_to_percent(value double precision) RETURNS double precision
|
|
80 | 80 |
LANGUAGE sql IMMUTABLE STRICT |
81 | 81 |
AS $_$ |
82 | 82 |
SELECT $1*100. |
... | ... | |
238 | 238 |
|
239 | 239 |
|
240 | 240 |
-- |
241 |
-- Name: _pct_to_frac(double precision); Type: FUNCTION; Schema: functions; Owner: -
|
|
241 |
-- Name: _percent_to_fraction(double precision); Type: FUNCTION; Schema: functions; Owner: -
|
|
242 | 242 |
-- |
243 | 243 |
|
244 |
CREATE FUNCTION _pct_to_frac(value double precision) RETURNS double precision
|
|
244 |
CREATE FUNCTION _percent_to_fraction(value double precision) RETURNS double precision
|
|
245 | 245 |
LANGUAGE sql IMMUTABLE STRICT |
246 | 246 |
AS $_$ |
247 | 247 |
SELECT $1/100. |
... | ... | |
249 | 249 |
|
250 | 250 |
|
251 | 251 |
-- |
252 |
-- Name: _pct_to_frac(text); Type: FUNCTION; Schema: functions; Owner: -
|
|
252 |
-- Name: _percent_to_fraction(text); Type: FUNCTION; Schema: functions; Owner: -
|
|
253 | 253 |
-- |
254 | 254 |
|
255 |
CREATE FUNCTION _pct_to_frac(value text) RETURNS double precision
|
|
255 |
CREATE FUNCTION _percent_to_fraction(value text) RETURNS double precision
|
|
256 | 256 |
LANGUAGE sql IMMUTABLE STRICT |
257 | 257 |
AS $_$ |
258 |
SELECT functions._pct_to_frac($1::double precision)
|
|
258 |
SELECT functions._percent_to_fraction($1::double precision)
|
|
259 | 259 |
$_$; |
260 | 260 |
|
261 | 261 |
|
Also available in: Unified diff
schemas/functions.sql: Renamed _pct_to_frac() to _percent_to_fraction() and _frac_to_pct() to _fraction_to_percent(), for clarity and for consistency with _percent (which is spelled out), as used by SALVIAS (http://salvias.net/Documents/salvias_data_dictionary.html) and elsewhere