General formatting function

rocatis
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...)
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
Senior NAV Developer
Elbek & Vejrup
0
Comments
-
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 formating0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions