Always round up or down

Hallo,
I´m looking for a function in DIAdem to always round up or down. I build myself some but they are old and slow... and they also work only almost perfect, some cases Just wont work right.
The aim is to round figures to 1/100, 5/100, 1/10, 5/10, to numbers, X mod 5 = 0, to x mod 10 = 0, to x mod 50 = 0 and so on.
I want to use it for scalling Report-Diagramms automatically, but with fixed and round scales - also for same scales of one meassurement in different Messures.
Therefor i need the funktion to Round Up always or in Minus Round down always.
If someone has a nice Solution for it i would be very thankfull.
Thanks already for ur surport.
STG

I'm not sure I fully understand the question, but hopefully this helps:
Frac = Return decimal portion of a number
Trunc = Return Integer portion of a number
intMyResult = Frac(Pi)    'intMyResult = 0.14159265358979
intMyResult = Trunc(-75.5109) 'intMyResult = -75
So a combination of these could give you:
Always Round Up:
  If Frac(Val) > 0 then MyResult = Trunc(Val) + 1
Example:
  Var =Pi
  If Frac(Var) > 0 then
    MyResult = Trunc(Var) + 1
  Else
    MyResult = Var '4
  end if
Always Round Down:
  MyResult = Trunc(Val)
Example:
  Var =Pi
  MyResult =Trunc(Var) '3
You can also combine this with multiplying&dividing by 10/100/1000 to round to specific numbers of decimal places
Example:
  Var =10.12345
  Var = Var *100
  Var =Trunc(Var)
  Var = Var /100
  MyResult = Var  '10.12
-Josh
Engineering Technician
John Deere Power Systems

Similar Messages

  • Always round up to nearest whole in APO DP

    Hi
    there is a requirement to always round up data to nearest whole number. number should be always rounded above and not rounded down.
    Example a value of 0.07 should be rounded to 1
    a value of 1.25 should be rounded to 2
    a value of 1.75 should be rounded to 2
    a value of 1.07 should be rounded to 2
    and so on
    Is there a way i can achieve in APO DP by some settings/paramater/config/macro/exit etc etc - i am on SCM 7.0
    Thanks,
    TJ

    Tejinder
    Try using the CEIL() function in a macro.
    Rishi Menon

  • Always Round Up

    I am trying to find a way to always round up to the next whole number. For example if I have 2.08 I need it to return 3. If I try this SELECT ROUND(2.08) FROM DUAL; it rounds to 2. I am using Oracle 11g. Any help would be appreciated. Thank you.

    Hi,
    sb92075 wrote:
    add 0.5 before applying ROUND() function
    Please do no use that!
    with t as
        (select 2.08 num  from dual union all
         select 2.00 num  from dual
    select
      num
      ,CEIL(NUM)          CEIL_NUM
      ,ROUND(NUM + 0.5)   ROUND_NUM
    FROM
      T
    NUM  CEIL_NUM ROUND_NUM
    2.08         3         3
       2         2         3 Regards,
    Peter

  • JMOD condition type value should be always rounded up instead of commercial

    Hi Helpers,
    I need one clarification from you all based on your expertise,
    1. JMOD condition type value should be always rounded up instead of commercial.
    2. i have been already made rounding up in the condition type JMOD in the transaction V/06. but unfortunatly not working.
    3. after that we found that there is configuration change in spro (company code setting in the indai taxation-CIN) in the Logistic general> tax on goods movement>india> basic setting> company code setting for the commercialrounding, but the same is  already ennabled with SD rounding IND.
    Need your expertise on this.How shall we make it round up always for JMOD condition value. below is an example for your further analysis.
    Example: if values UTXJ is : 8,913.40 and JMOD will be calculated based on UTXJ as 10% thats is 891.34.
    Actually this should be 892 as per the requiremen.t

    I just recently rolled off a project in Europe that had an issue similar to this.  We were having rounding issues as a result of %  discounts. 
    However, we did come up with a solution that is provided by SAP. 
    Please review OSS note 80183 on SAP rounding and the solutions provided within the note.
    I hope this helps.
    Kind Regards,
    Jason

  • Rounding - Always Round Up

    Hi All,
    Is there a way in T-SQL using the round command to always round up regadless of the value.
    For example:ROUND(normal_hours * pay_rate * 52, - 3) AS Expr3
    normal_hours = 36
    pay rate = 23.64
    weeks in year = 52
    (36 * 23.64) * 52 = 44,254.08
    It rounds to 44,000. I want 45,000.  Is this possible. Am I overlooking the obvious?
    Thanks in Advance and Happy Holidays!!!!!!!!Adam

    USE CoreDB
    GO
    --================================================================================
    --Name:  TIM SMOLKA
    --Date:  2014.08.05
    --Description:  Round factional pennies
    --================================================================================
    CREATE FUNCTION FN_ROUND_UP_PENNY
    @AMOUNT DECIMAL(18,6)
    RETURNS DECIMAL(18,2)
    AS
    --DECLARE @AMOUNT DECIMAL(18,6) = 1560891.00015445 
    BEGIN
    DECLARE @RV DECIMAL(18,2)
    DECLARE @FACTOR INT = 100
    DECLARE @TMP DECIMAL(18,6) = (@AMOUNT * @FACTOR)
    SELECT @RV = CEILING(@TMP) / @FACTOR
    --SELECT @RV
    RETURN @RV
    END

  • How to find out why my MBP will always try to shut down after 1 hour

    Dear all,
    this is a question too complicated for me to answer; I have previously tried to solve this problem in a usenet forum (comp.sys.mac.system) - but we didn't get it solved there, and I finally gave up on it. However, it still persists, and it is so annoying that I want to try another approach on it this time using the Apple Discussions Forum.
    The problem is as follows: my relatively new (bought in december '09) MacBook Pro 13" (2.53 GHz Intel Core 2 Duo, 4 GB RAM) has a problem: always when I leave it untouched for one hour, something within the system would try to make the computer shut down (system halt). Please note right that this seems NOT to be a hardware-related issue (al least not simply a bad mother-board or sth. similar - there are a lot of threads about MacBooks that seem to shut down immediately, like fainting - this is not the case here). Instead, the system behaves like anytime when a user-requested shut down is invoked - for example, the running applications would check if any changes should be saved, and ask questions. The only thing is: I did not request a system shut down, and even more: I do not WANT the system to shut down. In fact, this whole problem is extremely annoying, since it constantly messes up my open documents (e.g. the TextMate workspace I usually set up, or similar things), forcing me to reestablish my workspace at least once a day. Over time, this can be very annoying for a computer that's used for work!!
    During the course of my earlier discussions in the forum, we tried to find out what makes the computer go down - looking through the system log files etc. - but to no avail: we couldn't trace back the event that has caused the system to invoke the shut down procedure. However, it seems that this issue is related to the Mac operating system, and not the hardware - and this is why I ask this question here (and not in the MacBook Pro section). It may be that we simply didn't look in the right place - or not with the right tools - and I hope that there may be some people here with some new ideas how to trace the reason for this procedure. Everything I can tell now with some certainty (and I couldn't do it before in the usenet forum) is that the shutdown seems to be invoked about one hour after the system has been left untouched by a user (no key strokes, no mouse movements); I know this because I use my Mac for a wake up call now - and, since I sometimes need more than an hour for that, I can tell that this problem causes iTunes to quit one hour after the Mac has booted (which makes my wake-up music to switch off... and some of the running applications with no changes to save).
    It would be very important for me to solve and remove this annoying problem, and I think that this really shouldn't happen! Needless to say, I haven't set the energy savings settings such that the system would shut down after one hour (in fact, I have set the system to always stay on when attached to a power supply); still, the problem prevails.
    Does anyone of You specialists have a good clue or smart suggestion where (or probably how) else to look to find out what causes the shutdown? Thanks a lot for taking the time and considering this annoying problem!
    Best,
    Björn

    Yes - it is a bit frightening... Had other Macs before this MacBook (Pro), and never experienced such a problem. Don't know - of course I look into the Preference settings from time to time, and maybe I have changed that setting on the other computers... it never occurred to me...
    What an annoyance such a simple decision to make the auto-shutdown after one hour a default can be! Probably, Apple reconsiders :-D I'd rather prefer an auto-lock of the account (instead of an auto-log off)... but I believe it has been expressed often enough that, in this particular case, the - pardon me - Windows-solution (to offer a simple lock of the account, the Windows-L-key combination, IIRC) is much more practical... to copy that behaviour under Mac OS X, You'd have to go through lengths...
    Anyway! Pondind, thank You very much!!! Solved a kind of embarassing, but huge problem of mine!
    Best,
    Björn

  • Pages always prints envelopes upside down

    When using Pages to print envelopes, my HP laserjet always prints the envelope upside down. Apple and HP indicate I shoudl feed the envelopes with the top to the right. This works properly with everyother piece of software I have used
    I know, when I use Pages I could just change the orientation of the envelope in the envelope feed slot, or check "reverse page orientation" in the Print dialog (so the envelope is upside down in the print preview.) But I'd prefer not to have to remember random procedures to accomodate software malfunctions. Is there some preference I can set in Pages (or something) to fix this so it works correctly?
    PS.I hate to post this as a question, but the Apple Support Communities (SW platform, not the people ) has sort of forces this.
    Why in the world does it present "Ask a question" as the main option. Initially I skipped that, but the community search funcion really *****. Searching is incredibly non-intuitive and poorly targeted (If I'm in the pages section why is it giving me totally unrelated results from unrelated sections?
    Get on the ball Apple. You broke the "Support Communities" website and the OS X built in "Help Center" years ago, and still haven''t fixed them.
    Thank God for all the helpful Mac users out there, because Apple's help and support efforts (Help platforms, manuals, etc.) seem to have fallen by the wayside.

    Hi John,
    No help on your actual question, but some comments on the search function here.
    Search offers the choice of limiting the searsch to a specific community/forum when the first results are presented. You can also limit the search to a specific user.
    The basic search is a keyword search, and turns up any post that has that keyword in it (with some weighting added by then software). Searches search for "Any" of the terms included in the query unless you limit the results using commands such as  AND or NEAR. Not all that intuitive, I'll agree.
    One other feature of the ASC site is the 'related' topics list, "More Like This," that appears after you've submitted a query. You'll find the list to the right of the message(s) in the community. A click opn the (green) checked items will often provide a solution to your(well described)  issue.
    None marked 'solved' on the list at this time, but some worth exploring for hints or a solution.
    Regards,
    Barry

  • Rounding difference in down payment for header condition

    We have header condition, marked as "group condition" for traqnsport. But when doing down payment the system calculates incorrectly - for example I enter transport $600 at header level, but because the system calculates it at item level and due to rounding, in the 50% down payment invoice it shows - 300.02. Obviously when the customer receives down payment invoice that says pay 50% of some amount and the amount to be paid is not actually 50% it would be a problem. How could this be solved? We tried modifying the form, but as the it reads values from the system which are incorrect that didn't help.

    Hello,
    Please check the customizing:
    Financial Accounting -> Accounts Receivable and Accounts Payable
        -> Business Transactions -> Down Payment Received -> Define
        Reconciliation Accounts for Customer Down Payments
    Regards,
    Raghavendra

  • Frequency Control Word (PXI-5402): Rounded up or down?

    A further question wrt PXI-5402 standard function generation.
    The frequency control word is calculated by dividing the desired output frequency by the sample clock frequency (100MHz for a PXI-5402) and multiplying it by 2^N where 'N' is the width of the DDS accumulator (48 for the PXI-5402). As the frequency control word is an integer does any fractional residual result in the control word being rounded up or rounded down?
    e.g. if a I request a frequency of 1Hz I get a control word of 2814749.767 which would give an actual output frequency of 0.99999997 Hz if rounding down or 1.00000008 Hz if rounding up.
    Thanks.

    I believe the FCW gets rounded. I actually was able to find a LV demo for you, but it was made for the 5411. You would need to change some values to make it work for the 5402/5406: http://www.ni.com/example/28757/en/
    Keep in mind that all of the DDS calculations are actually implemented in HW on an FPGA, see figure 2: http://www.ni.com/white-paper/5516/en/. The tuning word here is the same as the FCW. This image used to be used on that white paper before it was updated. The adder in Figure 2 is the same adder in this image below.
    Also, as I have mentioned before, the accuracy for the Sample Clock above for the 5402 is 25ppm. If the actual frequency you are generating is such a concern, are you using an external high accuracy clock source? What is your application?
    Product Support Engineer
    National Instruments

  • Does turning down volume in app always have to turn down ringer?

    I have missed several calls because I turn down apps and it make the ringer equally as quiet.  I have the same problem on my iPad.  Any fixes?

    When installing Vista or Windows 7, I always advice people to remove their OS X drive so that Windows doesn't touch, tag, or know about OS X (also makes the install easier).
    Not sure why, but have you booted from another hard drive and run Disk WARRIOR - or at least Apple DU and tried doing disk repair? not sure it would help. Then zap PRAM and see if that changes this at all.

  • ED round Up or Down

    Dear All
    The requirement is
    For eg, if ED amount is Rs 100.49, then system should round down to Rs 100/-
        If ED amount is Rs 100.51, then system should rond up to Rs 101/-.
    Any clue, on how its acheived?
    Thanking you.
    Rgds
    Sumanth.G

    Hi,
    What's ED..if you're talking about a cond type value then what you're talking is commercial rounding and in V/06 in your cond type definition..you can configure it to commercial rounding--pls check.
    Regards,
    Raghu.

  • IMacs almost always refuse to shut down

    Hi,
    I have at home 2 iMacs and a MacBookPro, all running the latest OS.
    My 2 imacs have big trouble shutting down. Sometimes they do, but mostly they don't.
    Especially the most recent one (ALU) causes problems.
    I shut down, nothing really happens and after a while i get the message (for instance) "iCal refuses to shut down", while iCal wasn't even running anymore. I click ok, re-shut down, and after a while he tells me it's iTunes that refuses to shut down. Same thing, iTunes wasn't even running.
    This is driving me crazy... my iMac hasn't shut down normally for more than a week now...

    They're connected to the same router which never shuts down. There was never a problem before with this.
    Both of them have a seperate LaCie disk that i use as a backup with time machine.
    I don't know what NAS is. There's no central location for iTunes or iCal. The errors can mention other programs as well (excel, ...).
    I do have two MobileMe accounts (family and workrelated).

  • PlayBook battery level warning does not always work and shuts down without warning

    My BlackBerry PlayBook, operating on the new OS2, annoyingly shuts down at 12% battery life without any warning if I have anything open.  If open applications are reduced so that the desktop is visible, the PlayBook will alarm at 9% and and continue to run below this figure.   Does anyone have a solution to this or experienced this issue?  Thank you.

    Your Macbook is still under warranty.
    I would call Apple Support and see what they recommend. You don't have to purchase the AppleCare unless you want to.
    You have another choice.
    You can buy a new battery and see if that works for you.
    http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID?mco=F80 3127E&nplm=MA561G%2FA
    Then you could take in the original battery and have it checked out under warranty.
    Of course, you would probably end up with two batteries in the end but sometimes that is a good thing depending on how much you travel.
    You might also want to see this post:
    http://discussions.apple.com/message.jspa?messageID=3963944#3963944

  • BED & AED Round up or down without decimal places

    Dear Gurus,
    My client wants BED & AED Round up to nearest value without Decimal places.
    I am using taxinn procedure and JMOP for BED and JAOP for AED As a condition.
    I tried to tick round up in condition , but it is not workig.
    Please help.

    Hi,
    In TAXINN   T code : OBQ3  against ur condition in alternative calculation type (Calty ) column put 17.
    At the same time OB90 against ur company code put 100.
    Then ur problm will be resolved.
    Biswajit

  • What happened to the overwrite,always/ask/never pull down in the application builder. It was in 6.i. Any ideas on how to make the installer ask.

    The builder in ver 6.0i had a pull down to address the over write issue for support files. My new ver 6.1 does not. Is there a work around, a solution, or a new ver on the way? Thanks

    6.1 now uses the Microsoft Windows Installer. Information on that can be found here. I have download the SDK but haven't started to play around with it yet. There is editor included that I believe will allow you to change the settings in the msi file. I think right now, the default is to overwrite files if what's on the installer is newer.

Maybe you are looking for

  • PI 7.0: Message prioritisation in adapter engine for SOAP adapter.

    Hi All, We have both high and low priority synchronous messages using the SOAP sender Channel of the Central AE. How can we make sure that High Prio messages ALWAYS get a thread right away when entering the AE? Installing a separate AE is not an opti

  • Every time i receive an email on my iphone5 it is not being downloaded on my outlook why? thx

    i cant seem to have the same email downloaded on my iphone and my outlook, the emails are only shown on the iphone and not transmitted on the outlook... any help ? thk u

  • Sent mail is not being deleted on iPad.

    I read a support page that said it should automatically delete sent messages based on the setting for how many messages to display, after a time delay, but it is set to 20 yet I had 500 messages in a sent mail folder (pop account) dating back to earl

  • TV Shows playlist on iTunes help

    I am wanting to organize my movies since I just bought a new Apple TV.  I have a lot of movies in iTunes.  They are in the Movies section of the iTunes Library.  How do I move them to the TV Shows area of the iTunes Library.  I am wanting to "clump"

  • Cant install Flash Builder Burrito, help!!

    Yes, I have flash builder 4 installed, but I cant remove it as it's being heavily used for WIPs. should I remove the older version of Flash Builder, and can I use Burrito to continue developing my other Flex (web/Air for desktop) projects? Exit Code: