Turning string values in $ amounts
I have a string that I am receiving from the database. The issue is that the database often cuts off any decimal places that are deemed insignificant, for instance a value of 50.10 would read 50.1, is there an easy way to make sure that every output as two decimal places.
Interestingly, neither NumberFormat or DecimalFormat format a String.
Similar Messages
-
Getting the string value of a step in Test stand 3.1
Hi All , can anyone advise whicn control I use to retrieve the string value of the STEP name using v3.1.
It was the sequence context in earlier versions.
thanks dhtI'm assuming you want the step's name as a string? Inside TestStand there is the NameOf function that can be used with any TestStand object. i.e.
Locals.mystring = NameOf(RunState.PreviousStep) or something like this� You can access this function outside of TestStand by using the PropertyObject.Evaluate() method.
You could also use the TS API (in TS or in LV or someplace else) to start with a Step object, turn it into a PropertyObject, and then get its property �Name� which will return the string name of the step.
Third option off the top of my head is to explore the Hidden Properties of TestStand, that you have to enable by going through the Configure menu. There�s a knowledge base about it somewhere on the NI website if you�re curious. If you remember browsing fo
r the step name via a sequence context/expression browser before now, it was probably hidden properties that you were using.
Cheers!
Elaine R.
www.bloomy.com
Cheers,
Elaine R.
www.bloomy.com -
Zero value in Amount field during transaction upload into BPC
Hi Experts,
When I run DM package to load transaction data from BW to BPC,I am getting warning error with rejected list which contains amount field as zero value.
Is it possible to load records with amount value as Zero.My current EPM version is 10 SP14 Patch 1.
Currently my cube is in load mode .I have understood that during transaction data upload the cube should be in load mode and during inputting data using input forms it should be in planning mode.Please correct me if I am wrong.
Thanks,
RajuThanks for your quick turn around.
I have multiple keyfigures which have zero values in some records hence I am getting zero values in Amount field.
Shall I mark Real-Time data Target can be planned; data loading not allowed always.
Regards,
Venkat -
Parameters To Include Null Or Empty String Values
I have a table that has both Nulls & Empty Strings that I want to use as a Dynamic Parameter. Even though there is an indication of the Null/Empty String value when the parameter prompt comes up, selecting the value of Null/Empty String results in no records being returned. I have a formula to display the values in the report (where I substitute "Unknown" for the Null/Empty String values), but I am not able to do a parameter on that formula.
I guess in general, this is a situation of needing to be able to use a Dynamic Parameter based on a formula field.
Thanks for any assistance!
Edited by: Dragon77 on Apr 2, 2010 9:39 AMI'd use a SQL Command as the data source for the list of values. Something like this... (MS SQL Server)
SELECT DISTINCT
CASE WHEN t.StringField IS NULL OR t.StringField LIKE ''
THEN 'Unknown' ELSE t.StringField END AS StringField
FROM TableName AS t
ORDER BY StringField
Then use a formula like this in the selection criteria.
IF {?Parameter} = "Unknown"
THEN (ISNULL ({TableName.StringField}) OR {TableName.StringField} LIKE "")
ELSE {TableName.StringField} = {?Parameter}
HTH,
Jason -
How to get string value from xml in JSF??
In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF
Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization. -
How to get string value from database table using Visual Studio 2005?
Hi,
Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
Im using the below code to get the values from database table
bool Table::Get(char* FieldName,int& FieldValue)
try
_variant_t vtValue;
vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
FieldValue=vtValue.intVal;
CATCHERRGET
sprintf(m_ErrStr,"Success");
return 1;
Im using the below code to get the values.
AIErr getProjects()
char buf[5000];
int i;
std::string catName;
::CoInitialize(NULL);
Database db;
Table tbl;
errno_t err;
err = fopen(&file,"c:\\DBResult.txt","w");
fprintf(file, "Before Connection Established\n");
//MessageBox(NULL,CnnStr,"Connection String",0);
if(!db.Open(g->username,g->password,CnnStr))
db.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
fprintf(file, "After Connection Established\n");
if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
db.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
int ProjectID;
int UserID;
int ProjectTitle;
char ProjectName[ProjectNameSize];
if(!tbl.ISEOF())
tbl.MoveFirst();
ProjectArrCnt=0;
for(i=0;i<128;i++)
buf[i]='\0';
int j=0;
while(!tbl.ISEOF())
if(tbl.Get("ProjectID",ProjectID))
fprintf(file,"Project ID: %d ",ProjectID);
ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
sprintf(buf,"%d",ProjectID);
//MessageBox(NULL, buf,"f ID", 0);
j++;
else
tbl.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
break;
//if(tbl.Get("ProjectTitle",ProjectName))
if(tbl.Get("ProjectName",ProjectName))
MessageBox(NULL,"Inside","",0);
fprintf(file,"ProjectTitle: %s\n",ProjectName);
//catName=CategoryName;
ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
//sprintf(buf,"%s",ProjectName);
MessageBox(NULL,(LPCSTR)ProjectName,"",0);
else
tbl.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
break;
ProjectArrCnt++;
//MessageBox(NULL, "While", "WIN API Test",0);
tbl.MoveNext();
//MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
::CoUninitialize();
//sprintf(buf,"%s",file);
//MessageBox(NULL,buf,"File",0);
fprintf(file, "Connection closed\n");
fclose(file);
for(i=0;i<ProjectArrCnt;i++)
sprintf(buf,"%i",ProjectInfo[i].ProjectID);
//MessageBox(NULL,buf,"Proj ID",0);
//MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
return 0;
In the above code im geeting project D which is an integer value. But not able to get the project name.
Please some one guide me.As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.
-
Getting string values from DB query
I am using the following code:
<%@ page import="java.sql.*" %>
<%
String userName = request.getParameter("usernameField");
String password = request.getParameter("passwordField");
String connectionURL = "jdbc:mysql://localhost:3306/babbemployees?user=DBUser;password=MyPassword";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection (connectionURL, "DBUser", "MyPassword");
statement = connection.createStatement();
String queryString = "SELECT * FROM tbemployees where userID='"+userName+"'";
rs = statement.executeQuery(queryString);
String isAuthenticated;
if (userName == rs.getString("userID") && password == rs.getString("password")[0])
isAuthenticated = "AUTHENTICATED";
else
isAuthenticated = "NOT AUTHENTICATED";
rs.close();
%>
<html>
<body>
<h1><%= isAuthenticated %></h1>
<hr>
</body>
</html>I am trying to get a String value for rs.getString() but for some reason this is not working out. Is there anything I can do to get the values for the queries in a String value?
Thanks,
HarlinWhen a ResultSet is returned to you, it is always positioned before the first row.
You need to insert a rs.next(); after your executeQuery(). -
Issue with MB51 - Value in Amount in LC column- Reg
Dear ALL,
I have an issue from Materia Ledger - while executing the report MB51 to view the material document with relevant to MIGO process (GRN with movement type 101), it has been noticed that some items it is picking up the value in amount in LC column and for some items it is NOT picking up the value, for this client Material Ledger is activated, please share your views on the subject..
Thanks & Regards
RambabuHI
check there if any FI document created or not for your material document for which you are not getting value
I think there will not there will not any FI document and check you have storage location tab on where tab in MIGO
if no storage location tab then its consumption
Regards
Kailas Ugale -
How do I know if I can convert a String value to an int value or not?
Hi,
I want to know how to make the judgment that if I can convert a String value to an int value or not? Assume that I don't know the String is number or letters
Thank youEncephalopathic wrote
Again, why?One of the problems (have been dued) in my codelab asks us to write a class as follow
Write a class definition of a class named 'Value' with the following:
a constructor accepting a single integer paramter
a constructor with no parameters
a method 'setVal' that accepts a single parameter,
a boolean method, 'wasModified' that returns true if setVal was ever called for the object.
a method 'getVal' that returns an integer value as follows: if setVal has ever been called, it getVal returns the last value passed to setVal. Otherwise if the "single int parameter" constructor was used to create the object, getVal returns the value passed to that constructor. Otherwise getVal returns 0.
The setVal(int y) returns nothing, so how do I know whether it has been called or not?
Thank you -
Can't assign a string value to a member of type TEXT in Calculation Manager
I can assign a string value to that member of type TEXT using a run-time prompt of type StringToNumber.
Example: "My Text Member" = {string_rtp};
However, I need to accompllish the same function without using a run-time prompts.
I have a planning application and I know that text along with all other non-numeric
values are stored on the relational side in the planning application schema.
It seems reasonable to assume that if this can can accomplish
with a run-time prompt that I could do also do it without a run-time prompt.
What appears to be lacking is a function like:
"My Text Member" = @StringToNumber(<String Literal>);
Clearly, this is already being done "under the covers" for run-time prompts. If
would appear to be a minor enhancement to expose such a function to developers.
NOTE: I suppose you would also need to add new syntax/function to identify a string
literal from say a member name. I'm wondering if this is the more difficult challenge
from a product perspective????When executing a Calculation Manager rule in Planning, the run-time prompt (RTP) is populated by looking up the outline information present in the relational Planning application database. If the RTP is of type TEXT, the strings displayed in the member select are from the from the relational Planning application database too. Subsequently when executing the Rule, the RTP's value is in fact the record ID (a number) which is then saved into the appropriate intersection in Essbase.
You need to bear in mind, the Rule is executed in Essbase. If Essbase needs to "write" a text, it would then need to connect to the Planning relational database to create a new record. The newly created record ID then needs to be feed back to Essbase, in order to store it in the appropriate intersection.
What you are suggesting, comes with a big overhead causing Essbase and the rule to slow. Thus, the disadvantages outweighs the advantages. -
How to generate a Unique key based on a some String value
Hello every one,
I am sorry , If I post this question in wrong group... I have a requirement to generate a unique key ( what every it may be alpha, numeric or alpha numeric) based on some String..
For ex : String str = "AbCX" - Gives a unique key based on "AbCX" value..
Is there any way we can get the unique value using Java ?
ThanksMay be not what you are looking for, but here's may idea:
use a sequence (db sequence) and add it the the string value. This way the value is unique, because the sequence is unique. So you could omit the string theoretically, but your requirement is met.
It's very easy to get a unique sequence number from the db using java, depending of the technology you use (which you did not say :-( )
Timo -
Hi,
I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
http://server/pages/Default.aspx?Title=Arup&Title=Ratan
But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
I have followed the
http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
Please suggest me.
Thanks | Arup
THanks! Arup R(MCTS)
SucCeSS DoEs NOT MatTer.Hi DH, sorry for not being clear.
It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
(or a Performance Point Dashboard etc.) and you insert it into your page and add
a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
with multiple values for one parameter. If you have any more questions let me know. See you, Ingo -
I'm using TestStand 2.0/Labview 6i to do a string value test. Is there any way to use a string variable in the edit string value test instead of an actual string?? This forces you to hard code a string to test against.
Hi ART,
You can also use the LimitLoader step to load your string into to step similar to the Numeric Step type.
There should be an example of this in the Resource Library | TestStand
Regards
Ray Farmer
Regards
Ray Farmer -
Runtime conversion of a string value to a primitive data type in java
can anyone of you give me an idea to convert a string value to a primitive data type during run time...i have the value and the type to which it has to be converted as String values...do you have any idea ,...pls share
String recvalvalue = inputval;
String recvartype = inputtype;
if (recvartype.equals("int")){
value0 = Integer.parseInt(recvalvalue);
else
if (recvartype.equals("double")){
value1 = Double.parseDouble(recvalvalue);
else
if(recvartype.equals("float")){
value2 = Float.parseFloat(recvalvalue);
else
if(recvartype.equals("Boolean")){
value3 = Boolean.parseBoolean(recvalvalue);
else
if(recvartype.equals("char")){
value4 = (char)recvalvalue.charAt(0);
else
if(recvartype.equals("String")){
value5 = recvalvalue;
else
if(recvartype.equals("byte")){
value6 = Byte.parseByte(recvalvalue);
//listA.add(6, value6);
// listA.g = value6;
else
if(recvartype.equals("long")){
value7 = Long.parseLong(recvalvalue);
else
if(recvartype.equals("short")){
value8 = Short.parseShort(recvalvalue);
} yes i can do this but the resultant value has to be assigned to a variable of a specific type which is here recvartype .....it has to be done dynamically automatically..if we know what type of data is that we can convert and assign to the type but we donot know when we run the program as the program will be supllied by someone and has to be executed -
How to align a String value to the right side inside a table column?
Hi,
I have a text view inside a table column which is mapped to a string attribute. I need to align the text in the text view to the right hand inside the table column. But its always getting aligned towards the left side. I have tried by setting the <b>hAlign</b> property of Element properties of Text View to <b>right / forced right</b> but still the text is getting aligned to the left side.
How do I align the String values in Text View towards the right hand side inside a Table Column?
Thanks and Regards,
Sayan GhoshHello Sayan,
if i do get it right, you are adding an TextView element to a Table Cell. Then you should consider setting aligment within the particular cell. By calling:
YourCell.setHorizontalAlignment(CellHAlign.RIGHT)
regards.
mz
Maybe you are looking for
-
Payroll Data Extraction - 0HR_PY_1 and BIWMONTH
Hi, I'm hoping someone can provide some clarification on an issue with a payroll data extractor please. I've searched the forums, and looked at the Business Content documentation, but I'm still not clear on one point. The extractor 0HR_PY_1 (Payroll
-
ipad air has the same passcode since purchase. not sure why suddenly passcode doesn't work.
-
Database Adapter: Selecting all data from table
Hi All I am new to SOA Suite and I am using Soa Suite version 10.1.3.1 and Jdev version 10.1.3.3. It is required to select data from one database using the database adapter and insert it in a table in another database. I implemented the flow using DB
-
Hi, How to get partner function address by Vendor no. Please tell me relation tables. Regards Dinesh
-
Trying to install Adobe Flash player says to quit "com.apple.webkit.plugin.64" don't know what to do. Anye help is appreciated.