How to Round to x Decimal places in memo field

Hi,

I've been attempting to do a rounding of a calculated value in a memo in my report without success. Fast Report shows (as an online example) Round(1.478, 2) = 1.48

Seems simple enough, yet no matter how I try to implement anything like this in the memo field, I just get exceptions raised, and told "too many parameters". The closest I come to something working is:

[Round((<frxDB1."ln37">/<frxDB1."count">)*100)]

As soon as I try to introduce ',2' anywhere, I get told "too many parameters" EG [Round((1.234),2)] will trigger an error.

I've used rounding operations on all sorts of platforms and applications, so no new concept over here. Fast Reports just not playing nice... You'll notice my example that does work, does not specify to how many decimal places it should round, so it defaults to none. IE 28.9 becomes 30.

What am I missing here?

As a side note, where do I go online to view other formulae structure etc. that can be carried out from within a memo. I am fully aware of the user manual found here: https://www.fast-report.com/public_download...rMan/index.html
however this does not seem to provide information about correctly structuring formulae within a memo field (well the search does not find anything anyway, try typing Round for example). Online searching provides no useful results either, aside from the brief hint mentioned at the top of this post.

Comments

  • gpigpi
    edited 1:44PM
    FR's Round function doesn't allow second parameter
    If you need another function - you may create your own user function. See a Developer's manual "Custom functions writing" chapter
  • edited 1:44PM
    gpi wrote: »
    FR's Round function doesn't allow second parameter
    If you need another function - you may create your own user function. See a Developer's manual "Custom functions writing" chapter
    Thanks for confirming this. I used a workaround for my problem by multiplying by 100 (to shift by 2 decimal places), Rounding, and then dividing by 100 again. This works but would probably be considered an abuse of resource. Thanks again.

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.