Deliver superior customer experiences with an AI-driven platform for creating and deploying cognitive chatbots
Deliver Awesome UI with the most complete toolboxes for .NET, Web and Mobile development
Automate UI, load and performance testing for web, desktop and mobile
A complete cloud platform for an app or your entire digital business
Detect and predict anomalies by automating machine learning to achieve higher asset uptime and maximized yield
Automate decision processes with a no-code business rules engine
Optimize data integration with high-performance connectivity
Connect to any cloud or on-premises data source using a standard interface
Build engaging multi-channel web and digital experiences with intuitive web content management
Personalize and optimize the customer experience across digital touchpoints
Build, protect and deploy apps across any platform and mobile device
Rapidly develop, manage and deploy business apps, delivered as SaaS in the cloud
Recently Chris Wallace has been writing about formatting numbers in XQuery; as you may remember, I did blog about an XQuery-based format-number function some time ago, providing a partial implementation.
Chris mentions my post in his Wikibooks entry, and he has been so nice to run some tests and identify a few bugs and limitations. As I've recently had to "enjoy" a red eye flight on my way back to Boston, I couldn't resist the temptation to fix some of those issues.
Attached is a better version; it includes also support for the typical functionality you would access through xsl:decimal-format. The XQuery includes the tests that Chris posted on the Wikibooks entry, plus a few more, whose results are:[cc lang="xquery"]
[/cc]This is far from being a complete solution; there are several patterns that are not supported at all; but it's getting better... As I commented here I do believe that format-number needs to become part of the XQuery language and natively supported by the engine, which is the direction where XQuery 1.1 is moving.
View all posts from Minollo on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.