I asked:
>Does anyone have a handler to convert a number to a currency?
>
>eg 1234567 > =�31,234,567.00

Peter kindly suggested a very comprehensive function, but I have settled on
something less ambitious:

function currency tTot
  set the numberFormat to 0.00
  add 0 to tTot
  put num of chars of tTot into n
  if n>9 then
    put comma before char -6 of tTot
    put comma before char -10 of tTot
  else if n>6 then
    put comma before char -6 of tTot
  end if
  return "�"& tTot
end currency

This has, in turn, raised manipulation (eg sorting) problems in the
financial reports of the program.


Question:
We have verifiable types for date, number, integer, point, rect and boolean -
How feasible is a currency "type" with a "currencyFormat"?

  if tValue is currency then...
  sort lines of fld "FinancialReport_1" descending currency by item 2 of each
  convert tValue to currency
  add var1 to var2 as currency
  set the alignText of item 3 of fld 1 to currency

Barking, or just whistling in obscurity?

/H

Hugh Senior
The Flexible Learning Company
Consultant Programming
Voice: +44 (0)1483.27 87 27
Web: www.flexibleLearning.com

Reply via email to