Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formating formula (two decimals)

Status
Not open for further replies.

sasas

IS-IT--Management
Jan 8, 2004
1
SI

I have a field: tblIZPIS_OBD_PLA_PRI_IZ.PLA_PRI_STOPNJA, which gives a number like 6,5% 1,0% ...but i'd need number like 6,50%, 1,00% ...so 2 decimals.

Why doesn't this work:

ToText({tblIZPIS_OBD_PLA_PRI_IZ.PLA_PRI_STOPNJA},2)

???
It gives me an error like this:
Too many arguments have been given to this function.

Thanks for help,
sasa
 
Right click the field and select format field, this may enable you to change the amount of decimals if it's a number.

The point is to post what TYPE of data it is if you need help.

I'll approach it assuming that it's a string to begin with since you have a %:

val(ToText(replace({tblIZPIS_OBD_PLA_PRI_IZ.PLA_PRI_STOPNJA},",","."),2,""))

Now you should be able to right click it and format it however you'd like, incluind changing the decimal and thousands character.

Including Crystal version and data types when asking for data type conversions will result in better answers than text based posts.

-k
 
The is typically no need to write a formula to format something. Just place the field on your report, right click on it, and format field.

For whatever reason, you see, to have a comma as a decimal separator and a % sign as a currency symbol, trailing. All of these are changeable options.

If you did write a formula of totext(), you would most likely see a text string exactly like what you see now.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top