# HG changeset patch # User sam # Date 1722779438 -25200 # Node ID b94b648df33c7299739da2c5eb40d500e5d1f745 # Parent 5de466f5f08718403617957dec2b37ff3dca8fe3 add: nicer string output for integer vecs diff -r 5de466f5f087 -r b94b648df33c semicongine/core/vector.nim --- a/semicongine/core/vector.nim Sun Aug 04 00:58:00 2024 +0700 +++ b/semicongine/core/vector.nim Sun Aug 04 20:50:38 2024 +0700 @@ -105,7 +105,10 @@ func toVecString[T: TVec](value: T): string = var items: seq[string] for item in value: - items.add(&"{item.float:.5f}") + when elementType(value) is SomeFloat: + items.add(&"{item:.5f}") + else: + items.add(&"{item}") & "(" & join(items, " ") & ")" func `$`*(v: TVec1[SomeNumber]): string = toVecString[TVec1[SomeNumber]](v)