On Sun, 21 Oct 2007 12:27:14 -0500 Larry Garfield <larry@garfieldtech.com> wrote:
I think I see the disconnect here. You're talking about a site admin level. I'm speaking strictly of a general code-level currency mechanism. The actual format string that would be passed in, yes, would come from variable_get() or something like that so that it's the same site-wide, just like were we to use DateTime in Drupal 7 (which I highly encourage) we would not, presumably, have every module author calling ->format() with their own string.
I hope I understood it right.
What I mean is that drupal should know as less as possible about what dates, currency and float are and *why* they have to be formatted in some way (eg. parenthesis vs. sign etc...) this should be up to the site administrator, to provide the right format string and to the application programmer, even rounding is not a task drupal should be aware of, nor exchange rates and timezones; or at least it may provide the information to the application programmer, but it shouldn't know how and why it is used.
Again, it seems we're addressing different problems. You're after a float version of the date() (or format_date()) function with site-wide defaults. I'm talking about currency as its own value entity independent of the administrative settings, on top of which defaults could be built.
If I understand it right... this is the not orthogonal part... If you're going to introduce a drupal-core object for currency *on top of which* default could be built, first we have to have an object that represent currency, then we have to add to that object facilities for formatting. I'm scared I don't have the time to wait for a committee to approve a currency object. At this moment my idea of a currency is an integer + # of decimal digits. If we want to provide "super-deluxe" formatting we could go all the way down as locale does and add: mon_grouping and all the other stuff. But it is a long long run. I was looking for any "DateTime" Object into 5.2 and I didn't find anything interesting other than in xmlrpcs.inc. I did look for anything related to drupal and datetime objects and I stumbled into: http://drupal.org/node/130694 http://drupal.org/files/issues/datetime.module.txt and here http://drupal.org/node/37405 with a reference to Drupal 7. hints? No matter what I'll end to do... but maybe there is some chance it could be recycled if I've an idea of what are the plans. -- Ivan Sergio Borgonovo http://www.webthatworks.it