Number to exponential format in mapping
Hi Experts,
I want to convert number to exponential format. (Example number 254 to 2.5400000000E+01), is this possible using FormatNumber function??? if not can you anyone provide me UDF for this.
Yes. You can use number format function.
http://wiki.sdn.sap.com/wiki/display/XI/StandardFunctionsinPI7.0
http://wiki.sdn.sap.com/wiki/display/HOME/MessageMappingFormat+Number
http://download.oracle.com/javase/1.3/docs/api/java/text/DecimalFormat.html
Refer this if you want to acheive this using udf-
http://www.exampledepot.com/egs/java.text/FormatNumExp.html
Similar Messages
-
How To Get rid of Exponential format in datagridview when the number is very large
When the number is very large like :290754232, I got 2.907542E +08. in datagridview cell
I using vb.net , framework 2.0.
how can I get rid of this format?
Thanks in advanceshould I change the type of this column to integer or long ?
The datagridview is binded to binding source and a list ( Of).
Mike,
I'll show you an example that shows the correct way to do this and a another way if you're stuck using strings in exponential format. The latter being the "hack way" I spoke about Friday. I don't like it, it's dangerous, but I'll show both anyway.
In this example, I'm using Int64 because I don't know the range of yours. If your never exceeds Int32 then use that one instead.
First, I have a DataGridView with three columns. I've populated the data just by creating longs starting with the maximum value in reverse order for 100 rows:
The way that I created the data is itself not a great way (there's no encapsulation), but for this example "it'll do".
Notice though that the third column (right-most column) isn't formatted at all. I commented out the part that does that so that I could then explain what I'm doing. If it works, it should look like the first column.
The first column represents an actual Int64 and when I show the code, you can see how I'm formatting that using the DGV's DefaultCellStyle.Format property. That's how it SHOULD be done.
The third column though is just a string and because that string contains a letter in it, Long.TryParse will NOT work. This is where the "hack" part comes in - and it's dangerous, but if you have no other option then ...
You can see that now the third column matches the first column. Now the code:
Option Strict On
Option Explicit On
Option Infer Off
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
With DataGridView1
.AllowUserToAddRows = False
.AllowUserToDeleteRows = False
.AllowUserToOrderColumns = False
.AllowUserToResizeRows = False
.AlternatingRowsDefaultCellStyle.BackColor = Color.Aquamarine
.ReadOnly = True
.SelectionMode = DataGridViewSelectionMode.FullRowSelect
.MultiSelect = False
.RowHeadersVisible = False
.RowTemplate.Height = 30
.EnableHeadersVisualStyles = False
With .ColumnHeadersDefaultCellStyle
.Font = New Font("Tahoma", 9, FontStyle.Bold)
.BackColor = Color.LightGreen
.WrapMode = DataGridViewTriState.True
.Alignment = DataGridViewContentAlignment.MiddleCenter
End With
.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing
.ColumnHeadersHeight = 50
.DataSource = Nothing
.Enabled = False
End With
CreateData()
End Sub
Private Sub CreateData()
Dim longList As New List(Of Long)
For l As Long = Long.MaxValue To 0 Step -1
longList.Add(l)
If longList.Count = 100 Then
Exit For
End If
Next
Dim stringList As New List(Of String)
For Each l As Long In longList
stringList.Add(l.ToString("e18"))
Next
Dim dt As New DataTable
Dim column As New DataColumn
With column
.DataType = System.Type.GetType("System.Int64")
.ColumnName = "Actual Long Value (Shown Formated)"
dt.Columns.Add(column)
End With
column = New DataColumn
With column
.DataType = System.Type.GetType("System.String")
.ColumnName = "String Equivalent"
dt.Columns.Add(column)
End With
column = New DataColumn
With column
.DataType = System.Type.GetType("System.String")
.ColumnName = "Formated String Equivalent"
dt.Columns.Add(column)
End With
Dim row As DataRow
For i As Integer = 0 To longList.Count - 1
row = dt.NewRow
row("Actual Long Value (Shown Formated)") = longList(i)
row("String Equivalent") = stringList(i)
row("Formated String Equivalent") = stringList(i)
dt.Rows.Add(row)
Next
Dim bs As New BindingSource
bs.DataSource = dt
BindingNavigator1.BindingSource = bs
DataGridView1.DataSource = bs
With DataGridView1
With .Columns(0)
.DefaultCellStyle.Format = "n0"
.Width = 150
End With
.Columns(1).Width = 170
.Columns(2).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
.Enabled = True
End With
End Sub
' The following is what I commented
' out for the first screenshot. ONLY
' do this if there is absolutely no
' other way though - the following
' casting operation is NOT ADVISABLE!
Private Sub DataGridView1_CellFormatting(ByVal sender As Object, _
ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) _
Handles DataGridView1.CellFormatting
If e.ColumnIndex = 2 AndAlso e.Value.ToString IsNot Nothing Then
' NOTE! The following is dangerous!
' I'm going to use coercion to force the
' string into a type long. TryParse will
' NOT work here. This can easily throw an
' exception if the string cannot be cast
' to a type long. I'm "depending on" the
' the string to cast. At the very least
' you might put this in a Try/Catch but
' that won't stop it from failing (if
' it doesn't work).
Dim actualValue As Long = CType(e.Value.ToString, Long)
Dim formattedValue As String = actualValue.ToString("n0")
e.Value = formattedValue
End If
End Sub
End Class
Like I said, only use that hack way if there's no other option!
I hope it helps. :)
Still lost in code, just at a little higher level. -
About the number of rows used to map data in Xcelsius
Hi Everyone:
I am using web services to fetch data into Xcelsius. The information I got from web service will increase in time and what I suppose is when I run out of rows to get all data I must open my Xcelsius model and select a greater range of rows on each component to get all the data that the web service is bringing.
Is there an alternative to avoid modifying ranges of data in crontrollers when rows mapped are not enough for the data you are fetching from a web service?
It is a bit confusing, I hope I've been clear enough. I really really will appreciate your opinions. If possible give me technical explanations.
Thank you,
Skull
Edited by: skull_buck on Aug 6, 2009 7:40 PMHi Greg
Thanks for your fast reply.
What you suggested is exactly what I am doing now, and also I increased the number of rows allowed to map en Xcelsius which are 512 by default.
I would like to know now, how many rows are advisable to increase? Because I am using some components and you must specify for each one a certain number of rows.
I test mapping 3000 and even 6000 rows but the model is too slow and I was not able to export the swf file in any format.
Thank you again,
Skull -
Cells in Excel file output formatted to exponential format
Hi ABAPers,
I have generated an excel file using the FM, ' SO_NEW_DOCUMENT_ATT_SEND_API1 ' and cells in certain column are diplayed in the exponential format in excel. I had converted all the data to be populated into character type.
As you may see, the Invoice Number ( vbeln CHAR 10 ) and the EAN Code ( ean11 CHAR 18 ) are in exponential format.
But, as I expanded the cells, Invoice Number was displayed correctly but not EAN Code.
Invoice Number - 5090002040
EAN Code - 4011100191006
Is it because EAN Code is only 13 Characters long when it was supposed to be 18?
Please suggest any alternate logic for the EAN Code.
Thanks.
Arun G NairHello Alex,
No spaces or apostrophes or inverted commas are to be added to the EAN Code ( 4011100191006 ).
I have tried fetching the value and storing it into a string and then assigning that string to ean code variable but didn't work out. At the moment it is being stored in a variable of character datatype.
As you may see, it works fine for Invoice Number, then why is it NOT working for EAN Code. They have the same character datatypes and are also asigned to variables of similar datatypes. -
Any1 aware of a function module to convert a number in exponential form
any1 aware of a function module to convert a number in exponential form to normal form...
eg... a no. like 8.00000000000004E-01
8.88888888888884E-01
and
a no. like 1.50000000000000E+00
9.44444444444442E-01I think you can just move from type F to type p.
p = f .
Regards,
Rich Heilman -
Function module for converting number to exponential???
Hi All
please tell me Function module for converting number to exponential.
Deepaktry:
REPORT Zconvertf.
parameters p1 type p decimals 2 default '4711.99'.
data f1 type f.
move p1 to f1.
write: / p1, f1.
hope that helps
Andreas -
How to set exponential format for a cell?
Hello! Can someone advise how to set exponential format for a cell in Numbers?
Hi Alejandro,
If you mean 1000 as 1E+03
Format Panel > Cell > Data Format > Scientific
Regards,
Ian. -
Convert Number to Sting in graphica mapping
Hi
I need to convert the number to string using graphical mapping in SAP PI 7.1
Please share the posts if any,
Regards
Blue
Edited by: hiddu4u on Nov 21, 2010 10:56 AMYou can do this using mapping UDF; UDF code will b something like this:-
int aInt = [input];
String aString = Integer.toString(aInt);
Edited by: Samiullah Qureshi on Nov 22, 2010 9:41 AM -
How to copy FDM setting (import format, dimension mapping, control table)
Dear All,
How to copy FDM setting (import format, dimension mapping, control table) from application to another application.
I found that only dimension mapping can be imported. Is there any way to copy FDM application quickly?
Thanks your helpIf you get a chance try the following script, it's so simple and easy to extract all the map data to XML and will help in to import back through Import script.
Sub MapExtractor()
'UpStream WebLink Custom Script:
'Created By: SatyaK
'Date Created: 12/08/09
'Purpose: This Script will produce a Account Map File for
' the current location.
'Execute the export
strFilePath = API.IntBlockMgr.InterfaceMgr.fExportMapToXML("File Path", PPOVPeriod)
End Sub
------------- -
Conversion decimal to exponential format
Hi to all,
I have a small requirement in PM module. In IK11 tcode we r giving the measurement point reading in decimal point.But in database table it will store in exponential format.
For example. If we will give measuremetn point reading - 55.0 (in measurement point category temperature). But it will save in database table like 3.4814999999999998E+02.But i dont know which function module will use to convert decimal to exponential format.Please tel me which function module will use......
Regards
GeethaHi
Pass the data in the decimal format the system will internally convert it Floating point format
or try this out
data : var(4) type p decimals 2 value '10.22',
float type f.
float = var.
write float.
regards
Ramchander Rao.K -
How do I let lightroom show the actrual number of files in a map and not a number including the total of all submaps?
If by "map" you mean directory or folder, in the Library menu there is a toggle for "show photos in subfolders".
-
Hi CRM Gurus,
Can anybody tell the transaction code for Maintain format for Mapping in ELM I am working on CRM2007
Thanks in Advance
ChandraHi Chandra,
IN case of SAP CRM 2007, the transaction for Mapping format is 'BSP_CRMD_MKTLIST_map' but it doesnot work on GUI anymore. ATleast in my case i was not able to save the Mapping format on GUI.
On UI you can successfully create the Mapping Format with Marketing Professional Role. This Mapping Format wil exists in MARKETING TAB.
Hope this helps in getting the successful configuration.
VS -
Displat Exponential number in text format
Hello Experts,
I have a requirement in which i need to download report output to excel format.I have a field which has value say 72644E236 and is displayed as it is in the ALV list ,but when i download it to excel sheet its displayed as 7,2644E+236 .But i want it to be diaplyed as 72644E236 when i download it to excel sheet.
I cannot use the option of GUI_DOWNLOAD also as my report is REUSE_ALV_BLOCK_LIST_APPEND which may have more than one report out put on same screen.
Can any one help me regarding this.
Thanks in advance.
Regards,
KoustubhHi,
If u want to convert 7,2644E+236 to 72644E236 ,
u can just move it to a char field and replace , and + with space
and then condense with no-gaps.
then u can display the char value
Regards,
lavanya -
How set the format of map scale(e.g. 1/2000) in the JTextField?
Hi, folks. My company buy a third party component, it contains a scale editor which is subclass of JTextField. However, I don't why this map scale editor allows people to entry number , ,alpha and space in it(it means every letter shown on the keyboard can be typed in the scale editor). My just want to know to how to set the certain format to let people to only type in the following format: 1/200000.
By the way, because it is part of the third party component, so all I can do is get the instance of the JTextField from the component and set the format to it.
Thanks in advance.Hi, folks. My company buy a third party component, it contains a scale editor which is subclass of JTextField. However, I don't why this map scale editor allows people to entry number , ,alpha and space in it(it means every letter shown on the keyboard can be typed in the scale editor). My just want to know to how to set the certain format to let people to only type in the following format: 1/200000.
By the way, because it is part of the third party component, so all I can do is get the instance of the JTextField from the component and set the format to it.
Thanks in advance. -
Function to convert number to word format.
Dear Friends,
Could you please help me with a code that will take 'sum of all values of a column' as input parameter & return its value in word format.
Number can be negative , it can/can't contain digits after decimal.
i have two ways but it won't work when my no. becomes negative
Moreover i want that it should work on both type of data, numbers without decimal & number with decimal.
that is what i possess:
1)
function CF_1FORMULA return char is
num1 number;
p_number number;
type myArray is table of varchar2(255);
l_str myArray := myArray( '',
' thousand ', ' million ',
' billion ', ' trillion ',
' quadrillion ', ' quintillion ',
' sextillion ', ' septillion ',
' octillion ', ' nonillion ',
' decillion ', ' undecillion ',
' duodecillion ' );
l_num varchar2(50);
l_return varchar2(4000);
begin
num1:=:my_mumber;
p_number:=num1;
l_num:=trunc( p_number );
for i in 1 .. l_str.count
loop
exit when l_num is null;
if ( to_number(substr(l_num, length(l_num)-2, 3)) <> 0 )
then
l_return := to_char(
to_date(
substr(l_num, length(l_num)-2, 3),
'J' ),
'Jsp' ) || l_str(i) || l_return||'Rupees';
end if;
l_num := substr( l_num, 1, length(l_num)-3 );
end loop;
return l_return;
end;
and
2)
select to_char(to_date(floor(1234.99),'J'),'Jsp')||' Rupees and '||to_char(to_date((1234.99-(floor(1234.99)))*100,'J'),'Jsp')||' Paise' from dual;
kindly help me.
Thanks & Regards
VishnuCommon question.
But you will have realised that already if you'd bothered to search the forum...
http://forums.oracle.com/forums/search.jspa?threadID=&q=number+to+word&objID=f75&dateRange=all&userID=&numResults=30
Maybe you are looking for
-
Dears: i have dmp file exported from version 10.2. Enterprise Edition with full=y option with multiple users and sechemas im trying to import it to version 11.2 Stander Edation first time im trying to import full = y below but i found a lot of errors
-
Essbase Full Export generating erroneously large data files
On 9.2.1. using BSO I have a 1 GB page file that routinely is exported for backups. generates 1 text file about 1.2 GB. using buffered i/o and rle compression. recently, the backup occurred as normal but generated 6 text files totaling 10GB. I did a
-
Cannot load the bookstore servlet
I am going through the bookstore tutorial of J2EE 1.4 final version, all the steps are fine, and finally I try to load the servlet with http://localhost:8080/bookstore1/bookstore, it says: HTTP Status 404 - /bookstore1/bookstore type Status report me
-
i was wondering if the average life of a fully charged battery is 3+ days when ocassional use? i was concerned because i got a new phone which i partially charged then used it till it discharged completey and with wi-fi on and it lasted 4.3 hours. no
-
Why can't I open Acrobat files?
I use Acrobat regularly and for some reason, I'm now having issues opening files. When I try to redownload the software, it tells me it doesn't support my system. I'm running Windows Vista and have used the Adobe Suite products many times in the past