
Problems with number format
As you might know, I am doing some Frontpage
VBA development, and the
requirements/challenges are in an "ever evolving" state at the moment.
:o)
I am taking some numbers from an Excel-spreadsheet and merging them into
a table in Frontpage. The format of the numbers in Excel is dependant of
the local-settings of the individual client-installation of Excel. This
is fairly understandable - but the problem arises when I do the merge in
Frontpage. The number format in the HTML-pages _must_ be American - e.g.
the number "two thousand one houndred eleven point 45" must be displayed
as
2,111.45
whereas - with European locale settings - it will be
2.111,45
in the source-data.
But how do I convert them ? - or more specifically, how do I ensure that
the number format of the numbers being inserted into HTML are _always_
EN-US ?
I made a small function to convert the dots and commas [1], but this will
actually also convert correct EN-US numbers to European format - which
was not intended.
I have looked a bit at the Format()-function, but it doesn't seem to fit
my requirements. I think I need some function, that will give me the
numbers in the format given as a input parameter to the function.
Does this function exist ?
[1]
Private Function convertToUSFormat(ByVal strCellData As String) As String
Dim strTmp As String
strTmp = ""
strTmp = Replace(strCellData, ",", "[comma]")
strTmp = Replace(strTmp, ".", ",")
strTmp = Replace(strTmp, "[comma]", ".")
convertToUSFormat = strTmp
End Function
--
Jesper Stocholm
http://www.*-*-*.com/ (online again)
Copenhagen, Denmark