Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Restored NumberToPrint to work with DRAGON coding (added additional o…

…ption to add commas)
  • Loading branch information...
commit 930e1620a49d40c85d800e12ef80b0a3e7af66a2 1 parent a203d63
Andy Shapiro authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 VBA/z_numeric.bas
14 VBA/z_numeric.bas
View
@@ -9,7 +9,7 @@ Enum NumberPrintReturnType
ReturnFormat = 2
End Enum
-Function NumberToPrint(Number As Variant, ReturnType As NumberPrintReturnType) As Variant
+Function NumberToPrint(Number As Variant, ReturnType As NumberPrintReturnType, ShowCommas As Boolean) As Variant
'---------------------------------------------------------------------------------------------------------
' NumberToPrint - Returns the number formatted or the format type
' - In : Number as Variant
@@ -41,9 +41,17 @@ Function NumberToPrint(Number As Variant, ReturnType As NumberPrintReturnType) A
Case Is > 100000
TextFormat = "0.0E+00"
Case Is > 10000
- TextFormat = "0,000"
+ If ShowCommas = True Then
+ TextFormat = "0,000"
+ Else
+ TextFormat = "0000"
+ End If
Case Is > 1000 'and < 10,000
- TextFormat = "0,000"
+ If ShowCommas = True Then
+ TextFormat = "0,000"
+ Else
+ TextFormat = "0000"
+ End If
Case Is > 100 'and < 1,000
TextFormat = "0"
Case Is > 10 'and < 100
Please sign in to comment.
Something went wrong with that request. Please try again.