\P [n]
Show or set display precision for floating-point numbers, i.e. the number of digits shown.
The default value of n is 7 and possible values are integers in the range [0,17]. A value of 0 means use maximum precision. This is used when exporting to CSV files.
$ q
q)\P / default
7i
q)reciprocal 7 / 7 digits shown
0.1428571
q)123456789 / integers shown in full
123456789
q)123456789f / floats shown to 7 significant digits
1.234568e+08
q)\P 3
q)1%3
0.333
q)\P 10
q)1%3
0.3333333333
.Q.fmt and .q.f to format numbers to given width and precision
q).Q.fmt[8;6]a / format to width 8, 6 decimal places
"0.142857"
q).Q.f[2;]each 9.996 34.3445 7817047037.90 / format to 2 decimal places
"10.00"
"34.34"
"7817047037.90"