Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Stop rounding in a calculated field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Stop rounding in a calculated field

    How do I get it to stop rounding?

    I have a calculated field that is set to 2 decimals with this simple calculation.
    DRP_COST*QTY.OR.DRP_COST*SIZE
    drp_cost is 2 decimals qty is 0 and size is 0 decimals.

    If drp_cost is 1.25 and size is 27 it should give me 33.75 no it gives me 33
    this only happens when the drp_cost is a decimal like 1.25 works fine
    when it is not a decimal like 2 or 3 or 5

    #2
    Re: Stop rounding in a calculated field

    DRP_COST*QTY.OR.DRP_COST*SIZE
    Is not the simple calculation you are expecting. That expression performs a logical bitwise or operation on the results of two numerical calculations

    DRP_COST*QTY
    DRP_COST*SIZE

    You probably want something like

    if(qty>0, DRP_COST*QTY,DRP_COST*SIZE)
    There can be only one.

    Comment


      #3
      Re: Stop rounding in a calculated field

      Originally posted by Stan Mathews View Post
      Is not the simple calculation you are expecting. That expression performs a logical bitwise or operation on the results of two numerical calculations

      DRP_COST*QTY
      DRP_COST*SIZE

      You probably want something like

      if(qty>0, DRP_COST*QTY,DRP_COST*SIZE)
      Thanks Stan
      That expression kinda works I know it is an expression I need I am just not good with them.
      I would guess I need a < or if > in the expression. There is always a number in the QTY, only some times a 1.25 in the SIZE.

      Comment


        #4
        Re: Stop rounding in a calculated field

        Say in words what you want.

        If size is greater than zero I want the result to be size times drp_cost, if not I want the result to be qty times drp_cost?

        if(size>0, DRP_COST*SIZE,DRP_COST*QTY)
        There can be only one.

        Comment


          #5
          Re: Stop rounding in a calculated field

          Originally posted by garyc View Post
          this simple calculation.
          DRP_COST*QTY.OR.DRP_COST*SIZE
          OK Gary..forgive me, but I must be dizzy with the flu..
          I've done math all my life..I dabble in programing here and there..
          But I don't understand this concept!
          You are saying you have a simple calculation!

          It is not even a calculation.
          Maybe simple, but not a calculation.
          A calculation would be something like:
          2*3=6
          There is ONLY ONE POSSIBLE OUTCOME TO A CALCULATION..THERE IS NO "OR".
          So, what is this "OR" all about?
          Are you referring to a filter expression?


          To illustrate my point, go to your IW and do this:
          Code:
          ?2.2*3.OR.2.2*4
          = 14
          
          2.2*3 should equal 6.6 Right? ..right.
          2.2*4 should equal 8.8 Right? ..right.
          So, how come the outcome is neither 6.6 nor 8.8?
          And where did the 14 come from?
          If you are done scratching your head..let's turn this into an IQ test:
          Where did the 14 come from?
          Perhaps you are not in the mood for any tests..but I don't really understand what is it you are trying to calculate?

          Comment


            #6
            Re: Stop rounding in a calculated field

            Thank you very much Stan that helps me understand what I am trying to do in the expression builder.

            Comment


              #7
              Re: Stop rounding in a calculated field

              Thats cruel Gabe, how many people younger than us have ever seen
              00001000 .or. 00000110 ?
              let alone work it out?

              Comment


                #8
                Re: Stop rounding in a calculated field

                I wasn't trying to be cruel..I was alluding to how computers can be cruel, deceiving and misleading..

                It is not unusual that someone, and I am pretty sure it is happening as we speak, will write a "calculation" which will throw an outcome and thinks he reached the promised land..
                It is putting out outcomes alright, but ones that have nothing to do with what was intended.
                It is cruel, because it makes you think it's working..
                If it wasn't for the "rounding", Gary would have never knew that the results he was getting were coming from Wonder Land and had nothing to do with what he was looking for..
                Word to the wise, always check your so called "calculations", manually, with a different program,..on a piece of paper..whatever..
                Never trust these computers..

                And Ray, you are getting there..but haven't explained the 14 yet?

                Comment


                  #9
                  Re: Stop rounding in a calculated field

                  I love it, Cruella DeVille
                  Yes I have, (I think)
                  Boolean OR the two binaries = 00001110 = 00BAh = 14DEC
                  Last edited by Ray in Capetown; 03-18-2013, 08:55 AM.

                  Comment


                    #10
                    Re: Stop rounding in a calculated field

                    Ray:
                    Well, two explanations are in order, though this will be taking this thread in a whole new um-intended realm:
                    1-How did you convert the decimal to binary?
                    2-More importantly, what does "OR" do in this calculation?
                    I say, let's not hijack this thread. Let's put it to rest. Evidently, Gary got the answer he needs and this is a whole new discussion outside the boundaries of this thread.
                    If you feel the urge and can't let go, maybe start a new thread.

                    Comment


                      #11
                      Re: Stop rounding in a calculated field

                      Late Final answer
                      1. Do you have to ask? 6=2+4 (2nd and 3rd bits) OR 8 (fourth bit) - remember 128,64,32,16,8,4,2,1 all on (one) = 255
                      2. The bitwise OR operator takes each bit in the two numbers, and if either of the numbers involved has a one in that bit, the resulting number has a one in that bit. Otherwise the resulting number has a zero in that bit position.

                      Am i a geek or what?
                      Last edited by Ray in Capetown; 03-18-2013, 12:24 PM.

                      Comment


                        #12
                        Re: Stop rounding in a calculated field

                        You are.
                        We will leave it there. No need to get into converting fractions into binary.

                        Comment


                          #13
                          Re: Stop rounding in a calculated field

                          Originally posted by G Gabriel View Post
                          I wasn't trying to be cruel..I was alluding to how computers can be cruel, deceiving and misleading..

                          It is not unusual that someone, and I am pretty sure it is happening as we speak, will write a "calculation" which will throw an outcome and thinks he reached the promised land..
                          It is putting out outcomes alright, but ones that have nothing to do with what was intended.
                          It is cruel, because it makes you think it's working..
                          If it wasn't for the "rounding", Gary would have never knew that the results he was getting were coming from Wonder Land and had nothing to do with what he was looking for..
                          Word to the wise, always check your so called "calculations", manually, with a different program,..on a piece of paper..whatever..
                          Never trust these computers..

                          And Ray, you are getting there..but haven't explained the 14 yet?
                          Gabe,

                          If you had the time or the inclination, I would warmly welcome you starting a new thread to develop this further.

                          David

                          Comment


                            #14
                            Re: Stop rounding in a calculated field

                            David:
                            Ray showed his way of converting decimals to binary. There are many other ways to do the same. He did also mention what the logical OR does in a bitwise calculation which basically is to look for a pattern.
                            He didn't touch on converting fractions to binary, but quite frankly, other than for an academic value, I am not sure what is there to benefit from this idle information? I don't believe anyone on this board is converting to binary or using bitwise calculations. I don't.

                            Comment


                              #15
                              Re: Stop rounding in a calculated field

                              Originally posted by garyc View Post
                              How do I get it to stop rounding?

                              I have a calculated field that is set to 2 decimals with this simple calculation.
                              DRP_COST*QTY.OR.DRP_COST*SIZE
                              drp_cost is 2 decimals qty is 0 and size is 0 decimals.

                              If drp_cost is 1.25 and size is 27 it should give me 33.75 no it gives me 33
                              this only happens when the drp_cost is a decimal like 1.25 works fine
                              when it is not a decimal like 2 or 3 or 5


                              I assume the calculation is not the problem. If your result is placed in a field with enough decimals then look at the display options of your form/browse/report. Choose a display with decimals
                              just my two cents

                              Ton
                              Most things are simple but unfortunately only after the first time

                              Comment

                              Working...
                              X