Преобразование (float)17 в (nchar)'17.00'
От: Miro Россия  
Дата: 20.07.04 13:29
Оценка:
Не знаю как задать критерии поиска по форуму поэтому открываю тему.

Как можно указать точность и др. при преобразовании числовых величин в строковые?

В частности, чтобы во всех записях было одинаковое количество знаков после запятой.
Re: Преобразование (float)17 в (nchar)'17.00'
От: romashka Удмуртия  
Дата: 20.07.04 13:37
Оценка:
M>Как можно указать точность и др. при преобразовании числовых величин в строковые?
M>В частности, чтобы во всех записях было одинаковое количество знаков после запятой.

Using CONVERT:

CONVERT ( data_type [ ( length ) ] , expression [ , style ] )

This table shows the style values for float or real conversion to character data.

Value Output
0 (default) Six digits maximum. Use in scientific notation, when appropriate.
1 Always eight digits. Always use in scientific notation.
2 Always 16 digits. Always use in scientific notation.


In the following table, the column on the left represents the style value for money or smallmoney conversion to character data.

Value Output
0 (default) No commas every three digits to the left of the decimal point, and two digits to the right of the decimal point; for example, 4235.98.
1 Commas every three digits to the left of the decimal point, and two digits to the right of the decimal point; for example, 3,510.92.
2 No commas every three digits to the left of the decimal point, and four digits to the right of the decimal point; for example, 4235.9819.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.