General formatting function

rocatisrocatis Member Posts: 163
I'm using NAV to build and export a text message which will in turn be displayed on a web site.

The web site adheres to whatever regional setting the web user has and displays dates, decimals etc. accordingly.

The problem is that the text I'm exporting to web contains both dates and decimals but because formatting has been done by NAV these do not adhere to the web user's regional setting.

NAV knows the language of the web user but I really don't want to have to write code to format my output to the multitude of languages that the web users could potentially be using. Thing is, Windows already knows how to format stuff correctly - select any country under Regional and Language Options and see for yourself.

Now, how do I utilize the fact that Windows knows how to format anything in any language? Ideally the FORMAT command should be enhanced as follows:

FORMAT(1234.56,0,'<Regional Setting,Swedish>')

which would incidentally result in "1 234,56" even though I'm using Danish as my regional setting which results in "1.234,56".

Anyone with bright ideas? I mean, this surely cannot be a totally never-seen-before problem, can it? (Google says it can...)
Brian Rocatis
Senior NAV Developer
Elbek & Vejrup

Comments

  • SofDanielSofDaniel Member Posts: 7
    Could you export a vb/java script text instead of a text.

    If it were possible to export something like :

    document.write(FormatDateTime(Date(),2))

    and embede it into script tags in your web page, windows would take care of the formating
Sign In or Register to comment.