Can't specify the exact number of decimals. - InfoPath Dev
in

InfoPath Dev

Can't specify the exact number of decimals.

Last post 04-07-2010 03:48 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-07-2010 01:59 PM

    Can't specify the exact number of decimals.

    This is a code question, but the code area states Qdabra??

     

    I am calculating cubic feet and want my answer to show with 4 decimals places.  I have the user enter the length, width, and height then I multiple them together and divide.  I get a number that has 8 decimal places and therefore, can't be saved to my database (also invalid data error on the field).

    I am using JScript and can't seem to find any examples.  I have tried the ROUND function, but it only accepts one parameter.  It doesn't accept the field and number of decimal places.

    Does anyone have any examples that I could use?  I have been stuck for two days on this issue.  I am not a heavy duty coder so...help please.  :-)

    Regards,

    Chris

  • 04-07-2010 03:48 PM In reply to

    Re: Can't specify the exact number of decimals.

    Hi:

    I'm not much of a JScript guru, but here's a link that suggests that you can use 'toFixed' to set the number of decimal places. The sample script looks pretty readable, so check it out and see if it helps.

    Hilary Stoupa

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.