LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Change Data to have a Decimal Point

    Employee
    Posted 03-22-2010 21:14

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Rapkat

    I have a field Chargeable Capacity and it's type is a string, I need to change the data from 0 to 0.00 to enable != to work between this and another string.


  • 2.  RE: Change Data to have a Decimal Point

    Employee
    Posted 03-23-2010 09:52

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ejones

    I'm not sure if I'm answering the right question, so here are two answers.
    1. You could convert all the values from strings to numbers and then do a comparison as a number. When comparing two floating point numbers for equality you should nearly always use an expression that subtracts the two numbers and checks the result of the subtraction is close enough to zero to indicate they are the same: i.e. abs(a - b) < 0.001
    2. It sounds like you would like to compare the results as strings but need the string representation of the number format to be the same. You could use format. In this case you might use strValue = format("%0.02f",numValue)