Currency format in Text Object

SemSem
edited 5:35AM in FastScript
Hi All

I can't correctly format a currency in Object Text.

I have a TextObject in Master Detail call Prezzo. On event OnBeforePrint I have insert a script :

procedure PrezzoOnBeforePrint(Sender: TfrxComponent);
begin
if <Corpo."ArtServ"> = false then
Prezzo.Text:=<Corpo."PrUnitario">
else
Prezzo.Text:=''
end;

where Corpo is a ADOTabe, field PrUnitario is a Valute and field ArtServ is a boolean.

in the option of object, format is CATEGORY : Number FORMAT: $ 1,234.50 and FORMAT STRING: %2.2m

for example if

<Corpo."PrUnitario"> = ??¬ 1250,50

it stamp 1250,50 not ??¬ 1250,50

why???

Comments

  • RamgotiRamgoti Comilla
    edited July 2011
    This line:
    Dim currency As Decimal

    You declared currency as a double. In order for you to string compare "Yen" with currency you need a string data type for currency.



  • edited July 2011
    I suggest you to get the code from other sites. There are many source available on net from where you can detail codding, you need only to install that code in your site.

  • edited 5:35AM
    Dear Sir,

    I am using Fast Report studio, 4.8 with VB6.

    I want to format number values in report.
    The values which are Negative values should be displayed in bracket without "-" sign. and other number values should be formatted as normally i am using to format with %2.2n

    Please help, i want to displat -1234.00 to (1,234.00)
    and 2345.00 to 2,345.00

    I am trying to write VB script in report code window but not getting it to work. PLEASE HELP

    Thanks,
  • edited 5:35AM
    I suggest you to get the code from other sites. There are many source available on net from where you can detail codding, you need only to install that code in your site.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.