0

I have a reference to a field in Autodesk Infraworks which shows the area number. Field contains float numbers, but they are displayed incorrectly. I.e. instead of 20.8 it shows 20.790000000000000. What tags can be used here to limit or round the number?

Pavel Pereverzev
  • 459
  • 1
  • 6
  • 21
  • Do you have any other possibilites from html, like javascript? Else it's a simple toFixed(), explained here: https://stackoverflow.com/questions/14862009/make-an-html-number-input-always-display-2-decimal-places – Sparky Oct 15 '18 at 11:44
  • @Sparky actually I can take value only in HTML. Software makes a link between object and html-tooltip where reference to a field is written like `%SUMMARY_AREA%` – Pavel Pereverzev Oct 15 '18 at 11:50
  • HTML does not limit numbers. It is a text markup language. There is some other software involved in your problem. You must identify that. – Eric Postpischil Oct 15 '18 at 11:52
  • @PavelPereverzev Could you link the html code you're using? And the fieldname/panel in Autodesk where you insert it? – Sparky Oct 15 '18 at 12:08
  • @Sparky I use Infraworks, there is a window called like "Datasource setting" (may be called another way, I use russain version). In this window there is a tab "Edit tooltip" where HTML code can be written. The simplest way to make a tooltip would be like `
    Area is: %USER_SUM_AREA%
    `
    – Pavel Pereverzev Oct 15 '18 at 12:14
  • Javascript functions can also be written there, however it's still impossible for them neither give an output values nor format `%USER_SUM_AREA%` data. – Pavel Pereverzev Oct 15 '18 at 12:18
  • The Autodesk Infraworks manuals tell me that only `visual formatting` can be used. But if you say you can use javascript. Becasue you could write a javascript function for an `onLoad` on the html tag. But I'm unsure of your tooltip `documentready ` state – Sparky Oct 15 '18 at 12:41
  • @Sparky tested `onload`, seems like this method doesn't work here – Pavel Pereverzev Oct 15 '18 at 13:59
  • Sadly I don't have Infraworks myself, so I can't test thoroughly. Maybe the forums of Autodesk is a better place to discuss this issue. – Sparky Oct 15 '18 at 14:04
  • @Sparky yes, I posted my question there too, but still there's no one who could answer. – Pavel Pereverzev Oct 15 '18 at 14:12
  • Then I think it might not be possible. Is there a solution in the common settings of Infraworks? Or is there an available API? – Sparky Oct 16 '18 at 16:32
  • @Sparky unfortunately none of these. API is still not available, however API's documentation (up to 2014 year) exists. I try to test some snippets there to fill some fields with float data converted to string. But as for me it's not good solution – Pavel Pereverzev Oct 17 '18 at 09:02
  • Then it stops for me at this point. I hope you will find the solution. If you do, feel free to tag me here again and tell me what you did. – Sparky Oct 18 '18 at 11:36
  • @Sparky found out yesterday. Here I posted an answer, however it is mostly about using Infraworks' inner javascript functions. https://forums.autodesk.com/t5/infraworks-forum/wrong-display-of-float-numbers/td-p/8333835 – Pavel Pereverzev Oct 18 '18 at 12:07
  • Awesome! So about this post. You can't mark it answered without answer. So I suggest to delete it. – Sparky Oct 18 '18 at 13:26

0 Answers0