to_char(1.0, '9th "Place"') : to_char « String Functions « PostgreSQL






to_char(1.0, '9th "Place"')


postgres=# SELECT to_char(1.0, '9th "Place"') AS first,
postgres-#        to_char(2.2, '9th "Place"') AS second,
postgres-#        to_char(pi(), '9th "Place"') AS third,
postgres-#        to_char(10, '99V99th "\\"Place\\""') AS shifted_up;
   first    |   second   |   third    |   shifted_up
------------+------------+------------+-----------------
  1st Place |  2nd Place |  3rd Place |   990th "Place"
(1 row)

postgres=#
           
       








Related examples in the same category

1.to_char: convert number to char
2.to_char(start_date, 'YYYY-MM-DD HH24:MI:SS')
3.to_char(123456789, '999G999G999D99')
4.to_char(123456789, '999999999')
5.to_char(123456789, '00999999999')
6.If space is not enough for display