前往Shuct.Net首页

Shudepb PB反编译专家长时间以来,为业内同类软件事实上的唯一选择.细节,彰显专业.态度,决定品质.

关于PowerBuilder的搜索

internationalization - PowerBuilder: international currency formatting - Stack Overflow current community chat blog Stack Overflow Meta Stack Overflow Careers 2.0 more stack exchange communities Stack Exchange sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site careers 2.0 Stack Overflow Questions Tags Tour Users Ask Question Take the 2-minute tour × Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required. PowerBuilder: international currency formatting up vote 2 down vote favorite Background Users in the US were our application's initial user base, but this has expanded to the point that Canadian, British, and Scandinavian users also use the system. The PowerBuilder datawindow didn't like the Scandinavian currency format with decimals and periods transposed (###.###,00). When we tried to set the format in the datawindow, it complained, saying something about the format not being valid. We cannot be the only people that have encountered this problem, but I didn't see a lot about this topic on the usual searches over the Internet. Our current workaround For the time being, one of the developers found a workaround, by having the login script change the currency format on the Windows operating system for the session, and putting "[currency]" in the datawindow field's format property to pick up the operating system's format. This seems to work but is a less than optimal solution in my opinion for a number of reasons. It requires that our Scandinavian users run the app via a different icon than the other users. I shouldn't have to go into details about how rotten it is to have two different icons to log into the app, plus the maintenance hassles of having each one kick off a different format script. It only solves the issue of currency formatting for a single currency in a user session. As our app becomes more international, we may need to be able to display a variety of currencies in the same report. There must be a better way I'm fairly certain someone will tell me I need to read Spolsky's unicode essay. But aside from that, I'm interested in details on a slicker PowerBuilder solution, if anyone has one. Thanks in advance. formatting internationalization currency PowerBuilder share|improve this question edited Apr 17 '09 at 14:33 asked Apr 17 '09 at 4:45 Bernard Dy 1,6031729 what PB version? – Claptrap Apr 23 '09 at 13:39 Version 10.2 at the moment, and we are looking to move to 10.5 soon. – Bernard Dy Apr 23 '09 at 15:36 add comment 1 Answer active oldest votes up vote 2 down vote From PB's help on Defining display formats: Number and currency settings To ensure that an application behaves the same in whichever country it is deployed, DataWindow expressions and the masks used in display formats and edit masks require U.S. notation for numbers. That is, when you specify a number in a DataWindow expression or in a number mask, a comma always represents the thousands delimiter and a period always represents the decimal place. You should also always use the $ sign to represent the symbol for currency. At runtime, the locally correct symbols are displayed for numbers and currency. The comma and period are replaced by the delimiters defined in the user's Number settings in the Regional or International Settings property sheet in the Windows Control Panel. The $ sign in the mask is replaced by the local currency symbol as defined in the user's Currency setting in the Windows Control Panel. For example, in countries where a comma represents the decimal place and a period represents thousands, users see numbers in those formats. Which is probably not the answer you were hoping to get... What I can suggest is this: For reports, use a computed field that will format the number any way you want, and display it as a string. For input fields, use the built-in currency mask. The user will probably feel more comfortable working with the default system locale anyway. share|improve this answer answered Apr 19 '09 at 9:19 eran 12.2k1652 add comment Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Stack Exchange Post as a guest Name Email required, but not shown Post as a guest Name Email required, but not shown discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged formatting internationalization currency PowerBuilder or ask your own question. asked 4 years ago viewed 1689 times active 4 years ago Community Bulletin blog Your communities list is now customizable Related 59 Currency formatting in Python 15 How to format an int as currency in C#? 11 Best Practice - Format Multiple Currencies 6 Proper currency format when not displaying the native currency of a culture 1 Display international currency 7 rails different currency formats 0 PHP Advanced Currency Formatting 2 Currency formatting with c++ 3 Currency formatting in .NET 2 Groovy currency formatting Hot Network Questions Socket wrapper class Are gods treated as creatures before they enter the battlefield? Invalid induction proof? Why does the energy gap for 蟺 - 蟺* transitions shrink with the size of the pi-conjugated system? Result about Context is inconsistent with the description of 鈥淧ower Programming with Mathematica鈥 difference between legacy and traditional? Working with symmetric polynomials What is the difference between ipNetToMediaPhysAddress and dot1qTpFdbPort? Trap: can't su as root, can't change group to wheel, ssh as root prohibited Vector bundles on vector bundles Is "applying similar operations from left to right" a convention or a rule that forces us to mark one answer wrong? Are two anti-virus better than one in protecting your computer? How can I better show players that enemies are not friends? Does there exist a system such that the additive identity is non-zero? Call a method without calling it What is the proper way to ask for compensation for pitch work? How to get single curved quotation marks in math mode Please help identify disaster movie How to make the legend box transparent in pgfplots? Why did Cypher betray Morpheus? Why can we still crack snapchat photos in 12 lines of Ruby? Is it a good idea to ask a future employer whether or not I might be allowed to do open source development? \centerline{} command alternative? Is the scope of my campaign too large? more hot questions question feed about help badges blog chat data legal privacy policy jobs advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Science Other Stack Overflow Server Fault Super User Web Applications Ask Ubuntu Webmasters Game Development TeX - LaTeX Programmers Unix & Linux Ask Different (Apple) WordPress Development Geographic Information Systems Electrical Engineering Android Enthusiasts Information Security Database Administrators Drupal Answers SharePoint User Experience Mathematica more (14) Photography Science Fiction & Fantasy Seasoned Advice (cooking) Home Improvement Personal Finance & Money more (12) English Language & Usage Skeptics Mi Yodeya (Judaism) Travel Christianity Arqade (gaming) Bicycles Role-playing Games more (21) Mathematics Cross Validated (stats) Theoretical Computer Science Physics MathOverflow more (7) Stack Apps Meta Stack Overflow Area 51 Stack Overflow Careers site design / logo © 2014 stack exchange inc; user contributions licensed under cc by-sa 3.0 with attribution required rev 2014.3.4.1420 Stack Overflow works best with JavaScript enabled