Pleas help with rounding decimal field
I have a totals field that is summing several fields. I wish to have this totals field provide a rounded sum. I've tried setting the trailing digits to 0 but it will not round up, only round down. I have a display pattern for the field of num{($z,zzz,zz9.99)} . Example 162.59 is displaying 162.00 in total field instead of 163.00. Is there something I'm missing or am I missunderstanding how a decimal field works?
code in "calculate" event:
var test=xfa.form.topmostSubform.personnel_page.person_1.salary_cost1.rawValue+
xfa.form.topmostSubform.personnel_page.person_2.salary_cost2.rawValue+
xfa.form.topmostSubform.personnel_page.person_3.salary_cost3.rawValue+
xfa.form.topmostSubform.personnel_page.person_4.salary_cost4.rawValue+
xfa.form.topmostSubform.personnel_page.person_5.salary_cost5.rawValue+
xfa.form.topmostSubform.personnel_page.person_6.salary_cost6.rawValue+
xfa.form.topmostSubform.personnel_page.person_7.salary_cost7.rawValue+
xfa.form.topmostSubform.personnel_page.person_8.salary_cost8.rawValue+
xfa.form.topmostSubform.personnel_page.person_9.salary_cost9.rawValue+
xfa.form.topmostSubform.personnel_page.person_10.salary_cost10.rawValue;
//this rounds the value upon exit of field
var result = MATH.round(test.value);
this.value = result;
In FormCalc you have a function which do just what you are looking for..
Ceil(162.59)
Put it in a messageBox and see the output..
form1.#subform[0].Button1::click - (FormCalc, client)
$host.messageBox(Ceil(162.59));
OR
You can use the Ceil function of the MATH object in Java Script.
form1.#subform[0].Button1::click - (JavaScript, client)
xfa.host.messageBox("" + Math.ceil(162.59));
Thanks
Srini
Similar Messages
-
Can someone help with auto-size fields in forms?
I created a form in Acrobat for my team members with auto-size text fields that allow to shrink the text when the field size is not large enough to show the entire text. When I then open the same form file with Adobe Reader on my machine with text that has shrunk in some field, I can see all the text and have also a scroll function when the text size has reached its lower limits and there is still more text to show.
However, when I receive the filled out forms back from other team members' iPads (they use my template created with Acrobat), the text didn't shrink as on a PC version and the scroll function is disabled. I checked the template and the fields are correctly set to auto-size left and they do work on my PC's and laptop's Adobe Reader. But the iPad version of Adobe Reader may cause some issues.
Can anybody help with solutions?
Thank you!
KlausThe filled version of your PDF document (20140722 Daily Meeting Report...pdf) is no longer a PDF form because it has been flattened.
Once an interactive PDF form (such as your template version) is flattened, all form fields are replaced with images of filled data. You can no longer interact with form fields, edit form data, or tap/click any buttons in the flattened PDF document. That is the reason why the text in auto-size text fields did not shrink.
When you email a PDF document (including a PDF form) in Adobe Reader for iOS, the E-mail Document dialog is displayed.
In this particular case, your team member must have selected "Share Flattened Copy".
If you would like to keep the interactivity of a PDF form, you can select "Share Original Document". Please advise your team members to select the "Share Original Document" option when emailing filled forms.
Unfortunately, once flattened, a PDF document cannot be reverted back to the original "unflattened" state. However, if your team members still have the original filled forms, they can resend the forms with the "Share Original Document" option.
Please let us know if you have further questions. -
I have a Flash site I'm working on that has a private login
area. The login is not meant to be high security, we just want to
limit access to current and potential clients who we give a
password to.
Here is the site in
progress.
What I need help with is the client login window. The login
field is in a pop-up when you mouse over the word "client login."
The temp password is forumdemo. When you use the button after
typing in the password, everything is fine. But when you use the
enter key, it initiates the "incorrect' action every time, even if
the password is correct.
This is driving me crazy because when I originally built the
login box as an entirely separate movie, the enter key worked fine.
If you want to see it working, just click on the "client login"
words rather than using the pop-up box.
The code is the same in both. The only difference is that the
password field, button and other elements are now a Movie Clip.
Anybody have any thoughts? The scripts are below; developed
with the help of people on this forum (thanks!).
Ignore everything else - the content is not finalized. The
final site will be our company website, with work samples and the
like, and the main page will include a working demonstration of
what we can do with Flash 8 and green screen video. We haven't
finished that stuff yet.I tried. it didn't quite do it.
I don't know how to trace the value of things, I'm still
lurnin', but what I did do, is replace the _root.password.text with
all of the following
_parent.password.text
_parent.loginPopup.password.text
_root.loginPopup.password.text
_root.loginPopup.password
I'm sorry to say none of them fixed the problem, and I think
my problem is that I don't know what you mean by tracing the value.
Well, I know what you mean, but I don't know how to do it. I'll dig
into the documentation, but if you or anyone has an easy answer,
I'll take it!
Thanks, I appreciate your help and all the help I've gotten
on this forum building that site. -
Help with City, State Field
Hi
I need help in take one field with the City, State to 2 fields. One with City and the other State. I know how to take 2 fields into 1 but what is the script for 1 into 2 using the "," has the divider?
Thank you in advance!Have a look here: http://w3schools.com/jsref/jsref_split.asp
-
Need help with Rounding a number.
I have 3 cells each with a formula in them. Please bear with me while I try to explain this.
Cell D18 contains the formula: =Sum(L18/C5) (L18's value is 58, C5's value is 10), So the value of the cell is 5.8. I need this number to round properly to 6. It does visually on the spreadsheet.
Cell F18 contains the formula: =Sum(E18/F5) (E18=28, F5=8) So the actual value of F18 is 3.5 which is rounded to 4 visually on the spreadsheet.
Cell G18 contains the formula =Sum(D18+F18). (D18 visually displays 6, F18 visually displays 4, therefore G18 should display 10). G18 actually displays 9. For some reason the calculations are still based on the actual calculations of D18 & F18, instead of the rounded displayed numbers. How do I get G18 to display the correct number of 10, rather than the rounded down number of 9?
I'm sure there's a simple fix that I'm just not understanding. I hope I explained my problem well enough, I'd appreciate any help I can get. These numbers are to calculate insulin dosage, so I need to be sure the math is correct.
Thanks in advance for any help!yvieinca wrote:
I have 3 cells each with a formula in them. Please bear with me while I try to explain this.
Cell D18 contains the formula: =Sum(L18/C5) (L18's value is 58, C5's value is 10), So the value of the cell is 5.8. I need this number to round properly to 6. It does visually on the spreadsheet.
Cell F18 contains the formula: =Sum(E18/F5) (E18=28, F5=8) So the actual value of F18 is 3.5 which is rounded to 4 visually on the spreadsheet.
Cell G18 contains the formula =Sum(D18+F18). (D18 visually displays 6, F18 visually displays 4, therefore G18 should display 10). G18 actually displays 9. For some reason the calculations are still based on the actual calculations of D18 & F18, instead of the rounded displayed numbers. How do I get G18 to display the correct number of 10, rather than the rounded down number of 9?
The explanation is that you don't understand what you are doing.
When you ask numbers to display 0 decimal, you don't ask it to round the contents but to display the rounded value.
A contents remains 3.6 but the display is 4
an other contents may be 3.6 too displaying 4
When you sum, you ask number to add the contents (3.6 + 3.6) which is 7.2 and you ask it to display the rounded value of this result. So you correctly see 7 not 8.
If you want to get what you described, you MUST force Numbers to round.
First,I don't understand how you may invent such a silly thing like =Sum(L8/C5)
You are asking Numbers to sum the result of the division L8/C5 to nothing.
The correct syntax would ask it to calculate the quotient, no less no more.
=L8/C5
but here we need to round so, in D18, enter
=ROUND(L8/C5,0)
in F18, enter
=ROUND(E8/F5,0)
In G18, =Sum(D18+F18) is silly too.
You are asking nummber to sum (D18+F18) and nothing.
The correct formula may be:
=SUM(D18,F18)
or
=D18+F18
Yvan KOENIG (from FRANCE samedi 13 juin 2009 18:05:33) -
Need help with rounding of wage types in IT0008
Hi,
We have a requirement to round off wage type 1003 - Monthly Salary in IT0008. The amount entered in this wage type has to be rounded to the nearest 10's for India, 100's for Japan and 1000's for South Korea. For all other countries it should be rounded to the nearest whole number.
I have tried this by setting up the Rounding Type to A/B/C and Rounding Divisor to 10/100/1000 in the wagetype characteristics table T511 for each of the above scenarios respectively but nothing worked.
If we cannot find a way to set this up through configuration, we are planning to use the user exit in IT0008 to achieve this functionality. So anay ABAPER's also might pitch in for help...
This is an existing wage type and we just need to apply rounding this time. Need expert advice pls...
Thanks,
PriyaActually A/B/C and 10/100/1000 should work but it start rounding off from decimal points. For example if you will put 1000 for round off then it will round off to 10.
Btw since you are going with user exit, you can do it. What you need to do is read the wage type and indirect valuation module (as indirectly valuated wage type don't give you amount so you need to read module variant and valuate the wage type) and then write the code for round off.
Let me know if you need some more clarification on this. -
Hey Guys, just got FCP 7 upgrade, need help with Depth in Field.
I just got the upgrade and really want to know how to use Depth in Field on video. Could anyone explain or direct me to a video tutorial. Because i bought a whole course from rippletraining.com and it doesn't show how to do this with video. Any suggestions ?
and it doesn't show how to do this with video.< </div>
Welcome to the family.
You can only use DOF with stacked 3D layers in Motion.
Be sure to try the manuals. Just open the Help system and type in your words.
bogiesan -
Help with the date field!!! in opportunity
hello friends!!!!
I have a requirement that in opportunity tab milestone we have created date profile with 4 different date types and position them to milestone tab in opportunity header data.
Now the issue is out these 4, 2 of them we wish to have as mandatory fields
date type desciption
ZNOH_CONTSIG Date of signature
ZNOH_COSTART Contract Start Date
Can you please help how is that possible..
what procedure will it be behind this !!Hello Manuel Rodriguez
I have awarded you 6 points for your helpful answer as it didn´t solve my question posted here but a related issue was solved.
I tried to use the incompletness procedure and also the badi but in both the ways you can check for a field but in my case in opportunity tab milestone
it looks like an ALV with CRM concept it has date profiles behind that using date management in SPRO. Please have a look if possible.
Any help would be gr8 and any ideas from people which can give me any infos about it will be great!!!!!!!!!!!
Many thanks in Advance.
Pankaj -
Sorry if this is a repeat. I was interrupted and found that my browser had crashed when I came back so I'm not sure if the question got asked.
I need a script for a date field (mm/dd/yyyy) where the user can only fill in a date that is between 12/31/1899 and the current date (whatever the date when the form is opened). I'm getting better at writing these but I haven't been successful with this one. Any help would be greatly appreciated.
Thanks!I have a feeling I already answered this question some time ago... Anyway, you can use this code as the field's custom validation script:
var minDate = util.scand("mm/dd/yyyy", "12/31/1899");
var maxDate = new Date();
event.rc = true;
if (event.value) {
var d = util.scand("mm/dd/yyyy", event.value);
if (d<minDate || d>maxDate) {
app.alert("Error! The entered date must be between " + util.printd("mm/dd/yyyy", minDate) + " and " + util.printd("mm/dd/yyyy", maxDate));
event.rc = false; -
Help with rounding to nearest multiples of n-1 !!
i need help writing part of a program;
start with int n, then round ***up*** to the nearest multiple of n-1; then round **this** value up to the nearest multiple of n-2. (the final step is to round up to the nearest multiple of 2)
eg
if n=10;
9 -> 18
8->24
7->28
6->30
2->34.
Please help me with this, i'm really not sure where to begin !it's a program to do with the approximation of pi;
so far i have;
public double pi (int n) {
double f; (this is the final value of the nearest
multiple of 2)
then from here i'm really not sure how to go about
it..... in other words i haven't gotten very far.Okay. I'm currious as to how this helps in the approximation of PI. Would you mind posting that?
I'll give you a few hints. The mod operator "%" tells you the distance a number is from the multiple of n immediately bellow a positive number.
The Math.IEEERemainder function tells you the distance a number is from the nearest multiple of n (whether above or below).
I'll leave it to you to figure out how to find the nearest multiple ABOVE the number, and how to use that to round the number. It's actually not all that hard.
- Adam -
Please help with dynamic form field names in cfloop
Hi,
I need to create a form with day, date, month, year and time for 12 months
Instead of coding them 12 times, I create day,date,month,year and time fileds in my form 1 time and then I use cfloop from="1" to="12" index="i" to loop these form fields 12 times.
I gave each form field name such as: <input type="text" name="ScheduleDate_# i #" value=" "> this way each of those field will be named differently such as:
ScheduleDate_1, ScheduleDate_2,ScheduleDate_3, ScheduleTime_1,ScheduleTime_2, etc
I'm facing problem when this form is submitted, I think the error has something to do with the pound sign (##) when it comes to updating the back end
I use MS SQL
It doesn like this:
<CFLOOP From="1" To="12" index="k">
<CFIF Len(Trim(Form.MeetYear_#k#)) NEQ 0 AND Len(Trim(Form.MeetTime_#k#)) NEQ 0>
<cfquery name="CreateSchedule" datasource="#DSN#">
UPDATE TableSchedule
SET SchedDay = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedDay_#k##">,SchedMonth =
<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedMonth_#k##">,SchedDate =
<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedDate_#k##">,SchedYear =
<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedYear_#k##">,SchedTime =
<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedTime_#k##">
Where SchedId = <cfqueryparam cfsqltype="cf_sql_numeric" value="#k#">
</cfquery>
</CFIF>
</CFLOOP>
Can anyone help please?You can't nest hash marks. Do this instead:
SET SchedDay = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form["SchedDay_" & k]#">
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/ -
Need help with rounding up a number
In my codes, there is a loop and when I cfdump the value, it
looks like this:
2.0,.3.0,4.0, all the way to 32.0, etc
I need to use these number in a For Loop from="1"
to="#ThisNumber#" but first I need to round it up so ThisNumber
will come out as a whole number and not with the dot zero
Is there a function in CF that can do this? Please help!alecken wrote:
> In my codes, there is a loop and when I cfdump the
value, it looks like this:
> 2.0,.3.0,4.0, all the way to 32.0, etc
> I need to use these number in a For Loop from="1"
to="#ThisNumber#" but first
> I need to round it up so ThisNumber will come out as a
whole number and not
> with the dot zero
> Is there a function in CF that can do this? Please help!
>
A quick glance at the documentation for mathmetical functions
turns up
int(), floor() and ceiling() depending on how you would like
to round
different types of numbers. -
Search help with multiple key fields
Hi,
I want to dispaly search help on a field from a internal table have multiple key fields i.e combination of fld1 + fld2 +fld3 makes one single row. Therfore can any one tell me how to return that single row , because if I am using function F4IF_INT_TABLE_VALUE_REQUEST I get only one return field that I select by which I can't get the actual line that I have selected as there may be more that one line for that field.
please suggest any way through programming not by creating any search help through se11.
thanksHi,
Use select query to select the fields & display them.
In the following code i've selected only a single field in select query but u can do it for more than 1 & proceed similarly.i've tried it before using this code.
SELECT WERKS
NAME1
FROM T001W
INTO TABLE ITEMP
WHERE IWERK = 'M011'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'WERKS'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
VALUE_TAB = ITEMP
FIELD_TAB =
RETURN_TAB = T_RETURN
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
S_WERK-LOW = T_RETURN-FIELDVAL.
Hope this helps.
Reward if helpful.
Regards,
Sipra -
Blackberry 8520 pleas help with creating a I.D. !
I can't create a blackberry I.d. Since I gotted my blackberry I've been struggling with it!!!! Help I can't create a blackberry I.D.it keeps on saying email adres exits!
Solved!
Go to Solution.Hello !
Complete the following to create a BlackBerry ID:
Note: We recommend using an email address that can be accessed through a desktop browser to keep record of the account notification emails.
From a PC, go to www.blackberry.com/blackberryid and click the link to Register for a BBID.
Review the BlackBerry ID Terms and Conditions, then click I Agreeto continue.
Complete the required fields on the BlackBerry ID sign-up page, then click Save.
Note: The Screen Name is a unique display name used to provide a way to identify the BlackBerry user's presence in various BlackBerry products and services without revealing any personal information. (Ex. When writing a review for an application in BlackBerry® App World)
Note: The Username is the BlackBerry ID accounts login name as well as the accounts associated email address.
Note: When creating a BlackBerry ID, the account password can not match either the recovery question or recovery answer.
A confirmation message will be displayed advising that the BlackBerry ID has been created successfully, click OKto continue. This will also send a confirmation email to the email address used for the accounts Username.
As part of the BlackBerry ID creation process an email will be sent asking to validate the email address used as the BlackBerry ID Username. To validate the email address click the link within the email message and when prompted enter the BlackBerry ID password
Note: The link within the validation email will expire after a 24 hour period. Please be sure to click on the validation link before the link expires. If the validation email in step 5 does not arrive in the email inbox please be sure it has not been blocked by a local or Internet Service Provider SPAM or junk filter.
Hope this resolves your Problem!
If your problem has been resolved then would request you to Click on "Like" and accept as "Solution" so that other Advisors doesnt invest there time on this Message anymore.
Thanks. -
Query help with round up of dates
Hi,
I have a problem with my query.
I am calculating the difference between two dates and I want to get the hours.
The problem is that I want the following to happen:
if the difference is x such that x > 0 it should round it up to 1 (example: x = 0.1 it should be rounded up to 1)
if the difference is y such that y >1 it should be rounded to 1 (example y = 1.05 it should be rounded up to 2)
i have the following query at the momet:
select to_char(arrivaldate,'DD/MM/YYYY hh24:mi:ss') as "ARRIVAL", to_char(departuredate,'DD/MM/YYYY hh24:mi:ss') as "DEPARTURE", round(trunc(mod((departuredate-arrivaldate)*24,24),2)) as duration from stay_log;
thanks.Hi,
Format your code so that the physical appearance of the code gives some hint as to what you're doing, as I did below.
When posting code on this forum, always type {code} tags at the beginning and end of formatted sections.
Do you mean that, instead of 21, you want to use the flightid from the main query?
If so, that's called a "correllated query". The tables in the main query (and their columns) can be reference in the sub-query, like this:
select flightid as "FLIGHT",
select destairport_id
from journey,
flight
where flight.flightid = stay_log.flight_id -- correlated to main query
and flight.journeyid = journey.journeyid
) AS "AIRPORT",
to_char(arrivaldate,'DD/MM/YYYY hh24:mi:ss') as "ARRIVAL",
to_char(departuredate,'DD/MM/YYYY hh24:mi:ss') as "DEPARTURE",
ceil((departuredate-arrivaldate)*24) as "DURATION",
cost as "COST"
from stay_log;Often, people give a table alias to the main query table that is being referenced in the sub-query, as shown below.
That's only required when the table name appears in both FROM-clauses.
select flightid as "FLIGHT",
select destairport_id
from journey,
flight
where flight.flightid = s.flight_id -- table alias s used here
and flight.journeyid = journey.journeyid
) AS "AIRPORT",
to_char(arrivaldate,'DD/MM/YYYY hh24:mi:ss') as "ARRIVAL",
to_char(departuredate,'DD/MM/YYYY hh24:mi:ss') as "DEPARTURE",
ceil((departuredate-arrivaldate)*24) as "DURATION",
cost as "COST"
from stay_log s -- table alias s defined here
;
Maybe you are looking for
-
Vendor wise Sales & Stock Report in SAP Retail
Hi, My requirement is: I need to develop a report for suppliers, showing them the sales and stock in each sales office. The report will be able to show the quantity in sales and stock for each sales office and a total for each one, in a determinated
-
I can go to itunes store, click redeem, and enter my code. But when I click redeem after that to add the money to my account from gift card, it just freezes. Any ideas?
-
The Great iMac FireWire Mystery
I'm stumped on this one and was wondering if anyone had any suggestions. A couple of months ago I replaced my mother's mirror door G4 (2x1GHz) with a 20" 2.16GHz Intel iMac (the last of the all-white iMacs). Her G4 had an 80GB and a 60GB internal har
-
No sound when convert videos to ipod
i have bought quicktime pro, and i can successfully convert videos onto my ipod, but there is no sound on them. has anyone got a clue how i can resolve this? thanks alot Windows XP
-
Whenever I open i-tunes it always freezes and comes up with the message 'not-responding' regardless if I have any of my apple devices plugged in.