Page 1 of 1

How to display the "degree" symbol?

Posted: Sat Jun 13, 2015 9:49 pm
by usli06
How do I display the "degree" symbol in a vsql result set?

For example, like this for a temperature:

74°F

Re: How to display the "degree" symbol?

Posted: Sun Jun 14, 2015 3:40 am
by NorbertKrupa
This is typically done at the presentation layer; not the database layer.

Code: Select all

dbadmin=> SELECT '72' || CHR(176) || 'F';
 ?column?
----------
 72°F
(1 row)

Re: How to display the "degree" symbol?

Posted: Tue Jun 16, 2015 3:01 am
by usli06
This is typically done at the presentation layer; not the database layer.
Heh heh, I agree! But I'm trying to create some descriptive text to store in a table column, in that I want to store the degree symbol in the database column. The CHR(176) works perfect. Thanks!!!

Re: How to display the "degree" symbol?

Posted: Tue Jun 16, 2015 3:12 am
by NorbertKrupa
usli06 wrote:I want to store the degree symbol in the database column.
This is a bad idea. You won't be able to get optimized encoding. Store just the integer component, then do your formatting.