I’m trying to find the best way to format an sql query string. When I’m debugging my application I’d like to log to file all the sql query strings, and it is important that the string is properly formated. Option 1 This is good for printing the sql string. It is not a good solution if the string is long
Tag: string-formatting
How can I format a decimal to always show 2 decimal places?
I want to display: 49 as 49.00 and: 54.9 as 54.90 Regardless of the length of the decimal or whether there are are any decimal places, I would like to display a Decimal with 2 decimal places, and I’d like to do it in an efficient way. The purpose is to display money values. eg, 4898489.00 For the analogous issue