Formatting Integers with different Cultures and formart + SQL Server 2012

Bandi
Posted by Bandi under Sql Server category on | Points: 40 | Views : 1001
Format() function can be used to formart the integers with different cultures. th2 3rd argument of FORMART() function defines the CULTURE part.... This is very useful for front-end display purpose.
DECLARE @d INT = 420;
SELECT FORMAT ( @d, 'c', 'en-US' ) AS USEnglishCulture; -- $420.00
SELECT FORMAT ( @d, 'c', 'fr-FR' ) AS FrenchCulture; -- 420,00 €
SELECT FORMAT ( @d, 'c', 'de-DE' ) AS GermanCulture; -- 420,00 €

SELECT FORMAT(@d, 'N', 'en-us') AS 'Number Format'; -- 420.00
SELECT FORMAT(@d, 'G', 'en-us') AS 'General Format'; -- 420

Comments or Responses

Login to post response