PI in JS

Applies to

Description

Constant which represents the PI number (approximately 3.141592...) (JavaScript PI Documentation).

Sample Source Pattern

Syntax

Math.PI

Examples

CREATE OR REPLACE FUNCTION circumference(radius float)
  RETURNS float
  LANGUAGE JAVASCRIPT
AS
$$
  function circumference(r){
    return 2 * Math.PI * r;
  }
  return circumference(RADIUS); 
$$
;
SELECT CIRCUMFERENCE(2);

Known Issues

No issues were found.

No related EWIs.

Last updated