Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » New options in double formatting
New options in double formatting [message #34318] Fri, 11 November 2011 15:10 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I have found it is quite difficult to force EditDouble to use ',' instead of '.' for decimal point, that lead to a chain of minor improvements...

First of all, Format now recognized ',' and '@' n/ne/nf/nl/v/ve/vf/vl formatting, first one forces decimal point to be displayed as ',', second one supresses thousands separators in i18n formatting (that is not exactly solving the original problem, but might be quite necessary sometimes too_:

Format("%n", 1234567.89) = 1234567.89
Format("%,n", 1234567.89) = 1234567,89
Format("%nl", 1234567.89) = 1,234,567.89
Format("%@nl", 1234567.89) = 1234567.89
Format("%@,nl", 1234567.89) = 1234567,89


Next, ConvertDouble::Pattern now performs "scan for decimal point" - it does Format(1.1) and then scans for ',' in result - if it detects one, it then forces Filter to force ',' as decimal point.

After these changes, forcing EditDouble to use ',' is just matter of calling Pattern("%,n")...
Re: New options in double formatting [message #35237 is a reply to message #34318] Tue, 24 January 2012 13:07 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Good!

It has been a while since checking what was new in U++.

I like and can use this:
Format("%nl", 1234567.89) = 1,234,567.89

Hope this is or will be in the documentation and easy to find.
Re: New options in double formatting [message #35238 is a reply to message #35237] Tue, 24 January 2012 15:28 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
nlneilson wrote on Tue, 24 January 2012 07:07


Hope this is or will be in the documentation and easy to find.


http://www.ultimatepp.org/src$Core$Format$en-us.html
Previous Topic: FindFile::GetPath
Next Topic: SqlCtrls - 'automatic' mode and reference example
Goto Forum:
  


Current Time: Sun Apr 28 21:12:53 CEST 2024

Total time taken to generate the page: 0.06740 seconds