I'm trying to make function that format a number correctly
ex.
1000 + "$###,###,###" -> "$1,000"
I'm using this format function
With this function:
ex.
1000 + "###,###" -> 100,000
How do I fix this? Would I use a flipString function to flip it and format with this function, then flip the number back? Thanks.
ex.
1000 + "$###,###,###" -> "$1,000"
I'm using this format function
Function Format$(Number,FormatString$) MakeFormat$="" NumberCount=1 For I=Len(FormatString$) To 1 Step -1 GetFormatChar$=Mid$(FormatString$,I,1) Select GetFormatChar$ Case "," MakeFormat$=MakeFormat$+"," Case "." MakeFormat$=MakeFormat$+"." Case "#" If NumberCount > Len(Number) Then GetNumberChar$="0" Else GetNumberChar$=Mid$(Number,NumberCount,1) End If NumberCount=NumberCount+1 MakeFormat$=MakeFormat$+GetNumberChar$ End Select Next Return MakeFormat$ End Function
With this function:
ex.
1000 + "###,###" -> 100,000
How do I fix this? Would I use a flipString function to flip it and format with this function, then flip the number back? Thanks.