Appending zeros in the end
Hi,
How can I add some zeros in the end of a field in the decimal places?
I need to have 6 decimal places, so which ever decimal place is not filled, should be filled with zeros.
Example:
If the value is 11.123
I need to convert it to 12.123000
If the value is 11.1
I need to convert it to 11.100000
Please let me know how can I do this conversion or whether there is any function module available for this.
Thanks,
Uma
Hi,
move the value field into character field.
then do like the below.
data:num(20) type c value '11.1',len type i,len2 type i,v1(10) type c,v2(10) type c.
split num at '.' into v1 v2.
len = strlen( v2 ). <b><<holds the value after decimal point,check the length, if it is less than 6 digits,
then append the reqd. no. of zeroes at the end>></b>
len2 = 6 - len.
do len2 times.
concatenate v2 '0' into v2.
enddo.
write:/ v2.
regards,
sowjanya
Similar Messages
-
Add Zeros at the Ending to make Length 20.
Hi,
I have a Target field WBS where the length should be always 20. If the length is less than 20, I shd add Zeros at the ending to make the length as 20. I think format Number cant be used in this case. Do I need to write a UDF or Is there any standard function
Thanks & Regards,
VarunHi Varun,
use this UDF:
StringBuffer sb = new StringBuffer();
int length = 20 - a.length();
for(int i=0;i<length;i++)
sb.append("0");
return sb.insert(0,a).toString();
The difference to the solution is the use of the StringBuffer class. This is better coding practice. Strings in java are immutable and concatenation of strings therefore very expensive.
Regards Sven -
Deleting Zeros at the end of fields in ALV report
I want to make an ALV report that include both integer and decimals in same column.
for example :
1 - 1234.0000
2 - 0.0027
i dont want to see zeros at the end of value.
But the type will be decimal and integer values will be shown with zeros at the end.
For Ex.
I want to take report like this ;
1 - 1234
2 - 0.0027
How can i make this?
Thanks.
Edited by: aydnbk on May 14, 2010 3:22 PMHello aydnbk.
As far as i know, there is no way to do what you want using standard ALV-Functions. There is a field 'DECIMALS' in structure LVC_S_FCAT, but using this field you could only define ONE setting, that would affect ANY value.
Furthermore i am asking myself, if this feature is really sensible - when numbers are right-justified, a global setting for the number of decimals makes it much easier to compare the values - at least this is my personal opinion...
If i had to do this trick, i would simply add some character fields to the output-structure and write the values to the charater-fields to enforce this quite special layout.
Additionally i would set the fields 'NO_OUT' and 'TECH' for the fields of type 'P', that are holding the values - 'NO_OUT' hides the column and 'TECH' ensures, that the field can not be selected in a user-defined layout.
Hope this helps.
Regards, Jörg -
I am running RoboHelp 10 on Windows 7 Enterprise SP1 64 bit OS.
WebHelp is appending characters to the end of the TOC entry's URL address. The characters "bc-n" where n is a number are being generated for all of the TOC Page Entries when I generate WebHelp output. We are exporting the HTML files for import into an application. The TOC Page Properties Link to: property does not contain the characters in RoboHelp.
We have standardized names defined for our application and the appended characters are not going to work in the application.
cid:[email protected]
When I use the generated html output in IE10 Version 10.0.9200.16635 Update Versions: 10.0.7 (KB2846071) the characters show up in the URL when I hover the mouse over the TOC entry as shown in the screenshot below.
cid:[email protected]
The two screenshots show that the Link to property does not have the characters "bc-7" but the URL address does.
Is there a setting or way to configure RoboHelp to prevent Robohelp WebHelp from generating and appending characters to the end of the URL address for TOC Entries?I have never known Rh add any characters so I think something else is at play here. Please open one of the sample projects and see what happens there. Click Open on the RoboHelp Starter page and then click Samples in the ribbon on the left.
See www.grainge.org for RoboHelp and Authoring tips
@petergrainge -
Convert Double to String without zeros at the end
Hello,
how can i convert a double-numeric to a string? I know how can do it but not how i can do it in a fast way.
When i use the "Number to Fractional String"-Object then a number
1,2 --> is canged to 1,200000
1,0 --> changed to 1,000000
what can i do that there are no zeros at the end?
Currently i´m reading the reversed string in a loop to remove the zeros, but this i to slow i think.
Is there a fast way?
Thanks for your helpExtract from the LV help :
Select Tools»Options to display the Options dialog box and select
Front Panel from the Category list to display
this page.
Use this page to set front panel options.
This page includes the following components:
Open the control editor with double click—Allows you to
double-click a control to display the Control
Editor window. Use the Control Editor window to customize
the appearance of a front panel object. This checkbox is unchecked by default.
Use localized decimal point—Uses the decimal separator for
the operating system instead of the period. This checkbox is checked by default.
Remove the checkmark from this checkbox if you want LabVIEW to use periods in
all cases for the decimal point. -
Hi to all,
while migrating from NW to OES, one clustered volume with one (and
always the same) folder is duplicated with an trailing zero at the
folders name.
Source is
USER:\Abteilung\Edv\
Destination is
/media/nss/USER/Abteilung/EDV0/
while
/var/opt/novell/migration/user2/log/filesystem.success.log
shows the correct destination
Copying USER:Abteilung/EDV/... to /media/nss/USER/Abteilung/EDV/...
But in fact a new folder ../EDV0/ (in capitals) ist created, even if the
folder ../Edv/.. exists. This behaviour ist just with this folder, all
other volumes and folders worked fin.
One thing here is special:
I have *copied* the files to the destination volume because of the need
to have loaded tsafs.nlm, which nback will use for miggui, with the
option /nocluster for IBM TSM purposes. After that, I triggered a
regular consolidation as described above and later I plan to synch files
and trustees using miggui.
Any hints on that silly thing?
TIA
TomOriginally Posted by mrosen
Tom,
On 04.03.2013 09:17, bwisupport wrote:
> But I think, your questions led me to the solution:
> The destination folder, copied with TotalCommander, was named 'Edv' (as
> TC shows the sources name too). Miggui sees a source called EDV, and at
> the destination a folder called 'Edv' and decides that these are two
> different folders. Because it is not possible having to folders with the
> same name (despite capitals) at the same place, a new Folder with
> trailing zero is created.
>
> I've deleted the 'EDV0', renamed the destination to EDV (cross-checked
> with Explorer and CLI) and restart a synch.
Hmmmm.... Something's very strange here anyways. Miggui *should* not
care about the case when the destination is NSS set to long namespace.
Either there's a bug in your version of miggui, or something else is
weird about that folder. It's also strange that TC and Windows Explorer
disagree on the capitalization. That again would lead me to the
assumption that something's broken originally with the source, like the
DOS and LONG namespaces on the source disagreeing somehow.
CU,
Massimo Rosen
Novell Knowledge Partner
No emails please!
Untitled Document
It sorta does. Apparently there's a bug in the miggui code that does this (although we only have it happen on OES2 SP3 to OES11 and it doesn't add a "0" at the end, it just stops processing after the main directory).
I've been waiting for NTS to file a bug report for over a month now.
anyway, Ramesh (the guy who kinda owns miggui) acknowledged there's a bug.
You can either:
1) use the migfiles command apparently instead of miggui
or
2) Rename the directory so that it matches, but with NSS you'll have to rename it twice. Like:
EdvX and then again to: EDV
Problem is with nbackup apparently that miggui uses. -
How to add zero at the end of a character string
Hello Experts,
I've a requirement where I need to do sum/total of various numbers and display it with $ sign as shown below.
I'm using a variable CHAR20 to display total with $ sign. The problem is if there is a 0 at the end of the total then variable doesn't display it as highlighted above in red. Can anybody please make suggestion ( a code sample will be great help ) how resolve this issue?
Many thanks in advance.Hi,
please check this code:
REPORT ztestcurr.
DATA: xv_prval TYPE char20.
DATA: xv_val1 TYPE dmbtr VALUE '12.67'.
DATA: xv_val2 TYPE dmbtr VALUE '8.21'.
DATA: xv_val3 TYPE dmbtr VALUE '13.72'.
DATA: xv_sum TYPE dmbtr.
START-OF-SELECTION.
xv_sum = xv_val1 + xv_val2 + xv_val3.
PERFORM print_val USING xv_val1.
PERFORM print_val USING xv_val2.
PERFORM print_val USING xv_val3.
PERFORM print_val USING xv_sum.
*& Form PRINT_VAL
* Print value
* --> XF_VALUE Value to print
FORM print_val USING xf_value TYPE dmbtr.
WRITE xf_value TO xv_prval CURRENCY 'USD'.
CONCATENATE '$' xv_prval INTO xv_prval.
CONDENSE xv_prval NO-GAPS.
write /1 xv_prval using edit mask 'RR____________________'.
ENDFORM. " PRINT_VAL
Regards,
Klaus -
How to make cash account balance Zero at the end of the year
Hi,
We have one account 200180 with 1000 Company code( Germany), and document currency is HKD(Hong kong Dollor), but LC is Euro and it is a cash account. At the end of the year, this account shows 0 balance in HKD, and 10,000 in Euro. I understand that it is because of difference in exchange rates every month. Shall I include this account in foreign currency valuation ? Any other way to make the balance is 0 in Euro?
RKHi men,
I think tcode F-05 can solve your problem. You should make some adjustment by using this tcode.
Good luck. -
Append data to the End of an Excel file
How can I add new data (of a new aquisition) to an existing excel file without erasing old data? I'd like to add the new data aquisition under the last data aquisition. I have not the excel toolkit.
I add here two file, the block diagram (i'm new in labview world ) and what i see in excel when i run my VI. With the program I wrote, i can just save every aquisition in different excel file.
I hope i have been clear, thank you for your time.
L.
Attachments:
how to save data acquisition in excel.jpg 51 KB
data acquisition_excel.jpg 20 KBOn the Write To Spreadsheet File function, there is a boolean input to append to file. Set that to TRUE.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Replace Function removing Zero from the end.
Hi ALL,
I'm runing following query
select REPLACE(52000.50,'.') from dualwhich is giving me output as
*520005*
But I need last zero also in the output. like *5200050*
Please help me if you have any solution.user2988171 wrote:
Thanks it worked only small chane in the above query..
select REPLACE(to_char('52000.50','999999.99'),'.') from dual Edited by: user2988171 on Jul 30, 2010 4:38 PMYou broke it again.
If you have a string and not a number right from the beginning then there is no reason to use TO_CHAR.
Simply run
select REPLACE('52000.50','.') from dual;Or use the correct version from Toon if you enter a number value.
Btw. If it is a number you could also simply muliply it by 100.
select 52000.50 * 100 from dual;Edited by: Sven W. on Jul 30, 2010 2:58 PM -
[SOLVED] Append images to the end of a page with apache?
I don't know if there is any way of doing this, but when viewing the generic apache "Index of /" page on some servers, I see an image at the bottom of the page. Unfortunately, I can't think of any example sites offhand. Is there an option in httpd.conf to do this, or am I crazy? I am positive that what I am talking about is not an image embedded into an HTML page, but an actual image that you can see when browsing files on an HTTP server, usually located by where it displays the system information, hostname, PHP version, etc.
Thanks
Last edited by itsbrad212 (2010-07-26 08:05:34)It's part of the mod_autoindex module. You give it directives like this to include a HTML file at the top and bottom (respectively) of the auto-generated indexes:
ReadmeName /FOOTER.html
HeaderName /HEADER.html
These files can then be excluded from the index listing:
IndexIgnore HEADER.html FOOTER.html
Last edited by fukawi2 (2010-07-26 04:20:10) -
Append a substring to the end of a string
I'm trying to dynamically generate my "where" clause for a
SQL query. I'd like to append a substring to the end of an existing
string. I tried "ListAppend", but of course that puts a comma
between the original string and the substring. I could use "Insert"
string function, but it seems rather a hassle to have to LEN the
existing string each time I want to append something to the end of
it. Is there an easy way to append a substring to the end of a
string?
Here's an example of the code (using the "ListAppend" that
doesn't work):
<CFSET whereStmt = "ads.ad_duedate + INTERVAL 1 DAY >=
NOW()">
<cfswitch expression="#vendorSort#">
<cfcase value="Yes"><CFSET whereStmt =
ListAppend(whereStmt, " AND ads.ad_vendor =
#AdSortBy#")></cfcase>
</cfswitch>On additional suggestion...
You can use WHERE 0=0 as the first comparison in your where
clause. This obviously is always true. The benefit is now you can
have as many if statements adding conditions you want without have
to worry about generating an invalid sql statement such as WHERE
AND userid = 5 ie
<cfset var sql = "">
<cfset sql = "SELECT * FROM Users WHERE 0=0 ">
<cfif GetOnlyActiveUsers()>
<cfset sql = sql & "AND Active = 1 ">
</cfif>
Note that there is a space at the end of every line to ensure
separation of statements. -
How do you force DAQmx output to 0 at the end of program execution?
I am using a 6713 to generate an arbitrary analog waveform on its output. However, once the labview vi has finished execution, the output voltage from the 6713 does not go back to 0 V. I have tried to force it back to 0 V by appending a 0 V amplitude waveform to the end of the analog waveform to mixed results (if I give it thousands of points, it goes to 0, but if I make it a more reasonable 100 points, it doesn't). How can I force the output back to 0 V. I tried stopping the task, clearing it, and stopping it and then clearing it. None of those worked.
Any help would be greatly appreciated.
Attachments:
6713 Interface.vi 144 KBFirst, I have to ask, did you write this VI?
It is very hard to follow and has a lot of confusing structures in it. IN the middle area where a lot of the DAQmx functions are, the error wire loops around so much it is hard to tell what is happening in what order. To the lower left, an array is converted to a cluster, the cluster is unbundled, the individual elements are fed to a compound addition to get a single value. Why not just use a sum array function on the original array?
The stop button is fed to the Stop Sign function. This is Abort execution which is the same as hitting the red stop button at the top of the VI. It ends the execution of the VI right then and there and doesn't allow anything else to happen. Read the context help for that function. As someone else has said on the forum, "Using the Abort button is like using a tree to stop your car. It will stop it, but there might be consequences."
How is this VI being run? Is the Run Continuous button being used? My guess is yes because I don't see any While loops and the only thing the stop button does is end the program abruptly.
You will need to rethink your whole architecture. Stuff that needs to happen once should be set up before a while loop that has wires leading to the while loop or uses a flat sequence to make sure that it happens first. This is you program initialization.
Everything that happens repeatedly would be in the while loop. The front panel Stop button is what ends this loop.
Anything that has to happen before the program ends like closing out tasks happens after the while loop (either by wires for dataflow or in 3rd frame of a flat sequence structure. With this, you should be able to reset your tasks so they output a zero voltage from the analog outputs before the tasks are closed and the program ends naturally.
Appending a zero to the end of the waveform won't help because if the waveforms run continuously, it will restart back at the beginning.
I would highly recommend looking at the example VI's for DAQmx functions and taking the tutorials for Labview that are available on the NI website.
Message Edited by Ravens Fan on 02-23-2008 10:45 PM -
Preserve a single space at the end of line using spool command
Hi,
Can you please help me to write the result of an sql query into a file with the last column of the row ending with a single space?
For example:
COL1DATA|COL2DATA|COL3DATA<space1>
As mentioned in the example the col3 value in the file should end with a single space. And there should not be any delimiters at the end of the row.
I tried with set trimspool on/off. But, it didn't work. When I say trimspool on - it is trimming all the trailing spaces.
When I say trimspool off - it is retaining all the trailing spaces to the size of the line.
But, I do not wish to modify the file through shell commands once it is written thru spool. I mean I do not wish to append spaces to the end of a line using shell script or any other method.
I do not wish to use other methods like UTL_FILE also.
Please help me how to do it using spool command?
Thank you.
RamanaMy requirement is that all the trailing spaces should be truncated except the last one in the row.Why?
As you have discovered a single column in sqlplus, is always a fixed length regardless of the size of the data, if the length of the data varies the output is padded to the maximum or line size with spaces. The trim and trimpsool commands are there to remove all the spaces from the end of a line if there are any. There are no commands to trim all the spaces except one, or even to trim all the spaces except two, or three even.
If you want such custom processing you should post process the file in the OS using sed, awk or perl or something designed for such things. -
How do I have a totalizer reset at the end of every month?
We are using Lookout 5.1 in an application that is receiving a Modbus input giving us a totalizer value. We need to have this value reset to zero at the end of every month. Also want the monthly total to be sent to an excell spread sheet. All help is much appreciated.
I think this NI Post will help you out....
Regards
Maybe you are looking for
-
Debugging is not working in R/3 from WebDynpro-ABAP developed webpage input
Dear Friends, We are facing a serious problem for debugging. Expecting valuable input for the same. Debugging is not working in R/3 from WebDynpro-ABAP developed webpage input in Production Server. The debugging (for WebDynpro-ABAP application) is wo
-
Syncing to selected contact group wants to delete files outside of it
Hello - I am trying to sync my iPhone contacts to my address book in a specific way. In my address book, I have my personal contacts - friends and family. I also have mailing list subscribers (which gets into the 1,000s - people with whom I am not pe
-
Transferring library to iTunes on a new computer
I have an extensive iTunes library on my old computer that I use for my video iPod. I recently got a new computer and want an easy way to transfer the library over to iTunes on that computer. When I plug my current iPod into the new computer it says
-
Web app: How can I make a web app input form post directly to a sub category
Please, how can I go about this? Some of the ideas coming to my head is to replace the section I require with the generated webapp input form code with this: <input type="radio" name="CAT_Category" value="{module_category, ID} onclick="javascript:
-
OMJ3 configuration not picked up in spool request
Hi all, I have configured the printer determination for an message output for 261 movements. When I check the testing data, one of the material doc, the message output shows the OMJ3 output type and printer being selected. However, when i go to the s