pi

Gets the mathematical constant p, accurate to 15 digits
, but only shows 11 when simply outputted.

pi() → returns numeric

Examples
Sample code invoking the pi function

pi()

Expected Result: 3.14159265359

numberFormat(pi(),"0.000000000000000")

Expected Result: 3.141592653589793

After 15th digit CF outputs 0's

numberFormat(pi(),"0.0000000000000000000")

Expected Result: 3.1415926535897930000

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub