You can call the Windows API from a custom function.

Mitchell Vincent wrote:
Yes, I know about creating a function but I'm wondering if I can hook
into the already-existing Windows API function for it. Currency
formatting is quite complicated (much more than just storing a
currency "symbol") and Windows has already done the leg work - I just
need to see gain access to the API function for it.

The reasons are complicated but suffice it to say that currency
formatting is one area that ReportMan (reportman.sourceforge.net) is
lacking in. It's really not the job of a database to do this stuff but
I'm left with either getting SQLite to do it on the fly or adding
another "formatted" text field for each currency field already in the
database.

Thanks Igor!

On 4/6/07, Igor Tandetnik <[EMAIL PROTECTED]> wrote:

Mitchell Vincent <[EMAIL PROTECTED]> wrote:
> I know it's a long shot but is it possible to use the Windows API
> GetCurrencyFormat() function to format currency strings?
>
> I need a layer between my database and report generator to properly
> format currency (money) strings for various countries.

I assume you want to have SQLite format values for you (though you are
talking about a layer above the database which seems to suggest
otherwise). You can install a custom function - see
sqlite3_create_function[16]. This function can do whatever you want,
including calling GetCurrencyFormat. Then you can do something like

select FormatCurrency(currencyValue) from ...;

Igor Tandetnik


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------






-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to