Found difficulty with this - the apostrophe character is not supported.
Ended up doing a format in SQL code to output the formatted mount alongside the raw amount, then an XSL variable to select the class of the span. Messy.
If anyone is interested here is the SQL format function, could be useful. As you can see, it's quite a specific format....
****** Object: UserDefinedFunction [Intern].[fFormatNumberAsString] Script Date: 07/14/2011 10:31:29 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Intern].[fFormatNumberAsString]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [Intern].[fFormatNumberAsString]
GO
CREATE FUNCTION [Intern].[fFormatNumberAsString](
@RawNumber FLOAT = 0
, @NumberOfDecimals INT = 2
, @ThousandDelim NVARCHAR(1) = ''''
, @DecimalDelim NVARCHAR(1) = '.'
)
RETURNS NVARCHAR(MAX) AS
BEGIN
DECLARE @FormattedNumber AS VARCHAR(100);
DECLARE @AfterDecimal AS VARCHAR(100);
DECLARE @Negative AS BIT;
IF @RawNumber < 0 SET @Negative = 1;
ELSE SET @Negative = 0;
SET @FormattedNumber = CONVERT(BIGINT, ABS(@RawNumber));
IF @NumberOfDecimals = 0 BEGIN
SET @AfterDecimal = '';
END ELSE BEGIN
SET @AfterDecimal = ROUND((FLOOR(@RawNumber) - @RawNumber), @NumberOfDecimals);
IF CHARINDEX('.', @AfterDecimal) <> 0 BEGIN
SET @AfterDecimal = @DecimalDelim + RIGHT(@AfterDecimal, LEN(@AfterDecimal) - CHARINDEX('.', @AfterDecimal));
END ELSE BEGIN
SET @AfterDecimal = '';
END
END
DECLARE @i AS INT;
DECLARE @j AS INT;
SET @i = 0;
SET @j = 0;
WHILE @i <> LEN(@FormattedNumber) BEGIN
IF @j = 3 BEGIN
SET @j = - 1;
SET @FormattedNumber = LEFT(@FormattedNumber, LEN(@FormattedNumber) - @i) + @ThousandDelim + RIGHT(@FormattedNumber, @i);
END
SET @j = @j + 1;
SET @i = @i + 1;
END
SET @FormattedNumber = @FormattedNumber + @AfterDecimal;
IF @Negative = 1 SET @FormattedNumber = '(' + @FormattedNumber + ')-';
RETURN @FormattedNumber
END
GO