Author Topic: Additional Tagging & Reporting Tools  (Read 937935 times)

redwing

  • Guest
If a tag value is decimal numeral (e.g. 1.03476), $Mul function gives an error: "$Mul failed: Exception has been thrown by the target of an invocation".

boroda

  • Sr. Member
  • ****
  • Posts: 4658
its very easy, but i'm afraid i cant make *optional* parameters. i think i'll add 3 log functions: $lg(float), $ln(float), $log(float, base).

boroda

  • Sr. Member
  • ****
  • Posts: 4658
If a tag value is decimal numeral (e.g. 1.03476), $Mul function gives an error: "$Mul failed: Exception has been thrown by the target of an invocation".
i don't want to support floating point numbers to standard functions as they will always return a float. but i can make dedicated float arithmetic functions: $AddFloat(), $MulFloat(), etc.

redwing

  • Guest
All sounds good. Then how about supporting $Round function too for formatting float numbers?

$Round(15.2768,2) would return 15.28 and $Round(7.12,0) would be 7.


boroda

  • Sr. Member
  • ****
  • Posts: 4658
http://www.mediafire.com/file/6g4caflcv0f6bq5/mb_TagTools_2018-02-02.zip

--------------------------------

new functions:

$AddFloat(number1,number2)

$SubFloat(number1,number2)

$MulFloat(number1,number2)

$DivFloat(number1,number2)

$Round(number,number_of_digits)

$Log(number,base)

$Lg(number) //log10

$Ln(number) //log e

redwing

  • Guest
Thanks!

All are working great except sorting issue with float numbers:



It completely ignores decimal point and minus sign.
Tried changing the virtual field's format to number, but it makes no differences.
Not sure this is something you can handle or Steven has to look.

Another issue is when rounded it drops all trailing zeros like the screenshot. Why not keep those zeros like 3.00 instead of 3?

boroda

  • Sr. Member
  • ****
  • Posts: 4658
for correct sorting of negative numbers (note that integers and floats are completely different): ask Steven to support this as i cant control mb behavior from plugin.

for trailing zeros: no problem, i'll make this.

redwing

  • Guest
@Steven,

Can you support sorting float numbers in virtual fields?

redwing

  • Guest
It's not easy to find the link for the latest version of this plugin. The link on the first page of this plugin thread directs to the deleted wiki page (documentation is not up to date as well).
I'd suggest putting the link for the latest stable version along with, if any, beta version both on the add-on page and the first page of this thread.

Also it would be nice if MB could list virtual functions enabled by this plugin as well. Otherwise users will always have to look up the function list scattered here and there.

boroda

  • Sr. Member
  • ****
  • Posts: 4658
not sure how plugin (or even mb itself) can list any functions. all plugin functions are enumerated on add-on page of main site near the bottom of page.

redwing

  • Guest
Template editor has function selector that lists all supported functions.
If Steven won't support this, maybe the plugin menu could have a command that shows the list (and example) of functions.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34371
Can you support sorting float numbers in virtual fields?
if you define the virtual tag as numeric in the field definitions dialog, the next v3.2 update should sort it correctly

redwing

  • Guest
Can you support sorting float numbers in virtual fields?
if you define the virtual tag as numeric in the field definitions dialog, the next v3.2 update should sort it correctly

Thanks!

boroda

  • Sr. Member
  • ****
  • Posts: 4658
Template editor has function selector that lists all supported functions.
yes, you are quite right, haven't noticed that i can switch from tag list to function list. but i suppose i cant show list of plugin functions in any convenient way by the means of plugin.

@Steven, maybe its not very important right now, but i think the number of custom functions will increase over time, so could you enumerate custom functions for all enabled plugins in mb standard function list?