Re: Is there a function for Converting a Decimal into BINARY ?

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Is there a function for Converting a Decimal into BINARY ?
Дата
Msg-id 4A973F7A.90805@hogranch.com
обсуждение исходный текст
Ответ на Is there a function for Converting a Decimal into BINARY ?  ("Ow Mun Heng" <ow.mun.heng@wdc.com>)
Список pgsql-general
Ow Mun Heng wrote:
> Hi Guys,
>
> Searching the net didn't give me much clues as to how to convert a Decimal
> number into BINARY.
>

well, a decimal number is a fixed point number stored in a modified BCD
format, which optionally can contain a decimal fractional component.

you likely would want to convert it to a INTEGER or BIGINT first,  then
cats it to BIT(n) where N is the number of bits you want.

В списке pgsql-general по дате отправления:

Предыдущее
От: "Ow Mun Heng"
Дата:
Сообщение: Is there a function for Converting a Decimal into BINARY ?
Следующее
От: "Harvey, Allan AC"
Дата:
Сообщение: Re: Is there a function for Converting a Decimal into BINARY ?