Hasan SAVUN Blog

Bir Elektronikçinin Günlüğü

String Format

SELECT TOP(5)CurrencyRateID, EndOfDayRate
,FORMAT(EndOfDayRate, ‘N’, ‘de-de’) AS ‘Numeric Format’
,FORMAT(EndOfDayRate, ‘G’, ‘de-de’) AS ‘General Format’
,FORMAT(EndOfDayRate, ‘C’, ‘de-de’) AS ‘Currency Format’
FROM Sales.CurrencyRate
ORDER BY CurrencyRateID;

CurrencyRateID EndOfDayRate  Numeric Format  General Format  Currency Format  
-------------- ------------  --------------  --------------  ---------------  
1              1.0002        1,00            1,0002          1,00 €  
2              1.55          1,55            1,5500          1,55 €  
3              1.9419        1,94            1,9419          1,94 €  
4              1.4683        1,47            1,4683          1,47 €  
5              8.2784        8,28            8,2784          8,28 €  

String.Format(“{0:0,0.##}”, dt2.Rows[0][1].ToString());

Hasan SAVUN

Bir Cevap Yazın