Skip to content
Advertisement

Use Convert() to add two digits the end of a number and a comma to the left?

I’m asked to use the CONVERT function to return the third column as a datatype that outputs 2 digits to the right of the decimal point and all comma’s to the left (i.e. 3, 106.34). Name it FormatTotal.

This is where I’m at.

Advertisement

Answer

This looks like a task for format():

N is the format specifier for numbers.

2 gives you the precision (ie the number of decimal digits).

en-US defines the comma separator for thousands and the dot separator for decimals.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement