Skip to content

Commit 9016e39

Browse files
authored
fix money column format (#72)
1 parent 5b7db7b commit 9016e39

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/sqlcmd/format.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ func (f *sqlCmdFormatterType) printColumnHeadings() {
219219

220220
var leftPad, rightPad int64
221221
for i, c := range f.columnDetails {
222+
rightPad = 0
222223
nameLen := int64(len([]rune(c.col.Name())))
223224
if f.removeTrailingSpaces {
224225
if nameLen == 0 {
@@ -327,11 +328,11 @@ func calcColumnDetails(cols []*sql.ColumnType, fixed int64, variable int64) ([]c
327328
case "BIGINT":
328329
columnDetails[i].leftJustify = false
329330
columnDetails[i].displayWidth = max64(21, nameLen)
330-
case "REAL":
331+
case "REAL", "SMALLMONEY":
331332
columnDetails[i].leftJustify = false
332333
columnDetails[i].displayWidth = max64(14, nameLen)
333334
columnDetails[i].zeroesAfterDecimal = true
334-
case "FLOAT":
335+
case "FLOAT", "MONEY":
335336
columnDetails[i].leftJustify = false
336337
columnDetails[i].displayWidth = max64(24, nameLen)
337338
columnDetails[i].zeroesAfterDecimal = true

0 commit comments

Comments
 (0)