I'm looking something similar to using in the BigQuery:
NUMFORMAT(MyPrice, '$###.###,##')
Example: NUMFORMAT(99999999.99, '$###.###,##')
Result: 99.999.999,99
P.S. By not using JavaScripts and e.t.c.
I'm looking something similar to using in the BigQuery:
NUMFORMAT(MyPrice, '$###.###,##')
Example: NUMFORMAT(99999999.99, '$###.###,##')
Result: 99.999.999,99
P.S. By not using JavaScripts and e.t.c.
Below is in pure SQL (BigQuery Standard SQL)
#standardSQL
CREATE TEMP FUNCTION NUMFORMAT(number FLOAT64) AS (
REPLACE(REPLACE(REGEXP_REPLACE(FORMAT("%'.2f", number), r'([\d,]+).(\d+)', r'\1=\2'), ',', '.'), '=', ',')
);
SELECT
NUMFORMAT(99999.99),
NUMFORMAT(99999999.99),
NUMFORMAT(12345678.09),
NUMFORMAT(-999.99)
with output
Row f0_ f1_ f2_ f3_
1 99.999,99 99.999.999,99 12.345.678,09 -999,99