High Definition eLearning
Welcome guest, is this your first visit? Create Account now to join.
  • Login:

Welcome to the Lectora and CourseMill Forums

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Nov 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    OK, I have just created a series of actions that does a great job of calculating the square root of a number the user inputs. I'm feeling pleased as punch. The only problem: it rounds to 2 decimal places. This occurs whether the number is small or large. Oddly enough, it happens even if I want the square root of a number like this: 2.7764 -- the answer displays as 1.67, which is close, but not close enough. Any way to get this to go to 4 (or more) digits?

  2. #2
    Member
    Join Date
    Nov 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Should clarify my question: I need the numbers to go to 4 or more decimal places. 


    jwest77 said:OK, I have just created a series of actions that does a great job of calculating the square root of a number the user inputs. I'm feeling pleased as punch. The only problem: it rounds to 2 decimal places. This occurs whether the number is small or large. Oddly enough, it happens even if I want the square root of a number like this: 2.7764 -- the answer displays as 1.67, which is close, but not close enough. Any way to get this to go to 4 (or more) digits?


  3. #3
    Member
    Join Date
    Apr 2006
    Location
    Kansas City, MO
    Posts
    393
    Thanks
    3
    Thanked 8 Times in 7 Posts

    Default

    I haven't tried this, but what if you divide the result by 100?  This would mean that you need to multiply the original number by 100 squared, of course.


    So, say the learner enters in 16.  The final result would, naturally, be 4.  You run these steps:
    Multiply 16 by 10,000 (160,000)
    Take the square root of that number (400)
    Divide by 100 (4)


    I *think* this may be enough to give you 4 significant digits.  If you need more than that, then you could multiply by 1 million and then divide by 1 thousand.  I would think that Lectora can handle that kind of calculation, but I'm not entirely sure. 


     


    At the very least, I hope this suggestion inspires you to find the correct solution.


    Kevin


  4. #4
    Member
    Join Date
    Nov 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Kevin, thanks for the quick reply. When I do as you suggest, I still end up with a 2 decimal place number.


  5. #5
    Member
    Join Date
    Apr 2006
    Location
    Kansas City, MO
    Posts
    393
    Thanks
    3
    Thanked 8 Times in 7 Posts

    Default

    I've had time to explore this in greater detail.  Sadly, it seems that Lectora rounds everything to 2 places.  Even when I divide a simple number by 10,000, I only get two places.  That's quite a shortcoming, actually.  Even if you don't have a maintenance plan, I would imagine you could call Trivantis and get an answer, because I think this is a feature that Lectora should offer, and it clearly does not. I personally think you are owed some satisfaction for this inconvenience.


    I'm sorry; I thought the dividing by 100 trick would have worked.  I must be thinking of another application where I've done that before.


    Kevin


  6. #6
    Member
    Join Date
    Apr 2006
    Location
    Kansas City, MO
    Posts
    393
    Thanks
    3
    Thanked 8 Times in 7 Posts

    Default

    So, rarely do I back down from a challenge, and I have found a way to display a number to 4 decimal places.  You can see the guts within the file I uploaded called "rounding exercise.awt."


    Note that I put a condition on the "Round lefthand" action.  If there is enough of a number after dividing by 10,000, then that number is used for the lefthand side.  If not, then it is blank.


    I have not messed with the righthand side much, but I think I can guarantee some rounding issues if the number ends in one or more zeroes.  You'd have to fine-tune the conditions...perhaps use Action Groups.


    This is not the best way to display the number (at least, I hope not!), but it may do in a pinch.  Once again, it hopefully will provide a springboard that gets you closer to the true answer.


    Kevin


  7. #7
    Member
    Join Date
    Jun 2010
    Location
    Watkins, CO
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with squaring a number

    Quote Originally Posted by jwest77 View Post
    OK, I have just created a series of actions that does a great job of calculating the square root of a number the user inputs. I'm feeling pleased as punch. The only problem: it rounds to 2 decimal places. This occurs whether the number is small or large. Oddly enough, it happens even if I want the square root of a number like this: 2.7764 -- the answer displays as 1.67, which is close, but not close enough. Any way to get this to go to 4 (or more) digits?
    I see that you have successfully determined how to do a square root....do you have any suggestions for creating a square of a number? I would like the user to enter a number then have Lectora square the entry....ultimately that number would be multiplied by a fixed value (constant).....I'm a novice-intermediate user of variables so be gentle! Thanks for any help you can provide.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Lectora and CourseMill are registered trademarks of Trivantis Corporation, Camtasia and Snagit are registered trademarks of TechSmith Corporation and
Flypaper is a trademark of Flypaper Studio. Camtasia and Snagit are used with the permission of TechSmith Corporation.
Copyright © 1999-2012 Trivantis Corporation Inc. All rights reserved.