Converting string to 2 digit decimal number
Hi all,My question is how to convert a string like 80.00 to a number with 2 decimal digits. I've tried many solutions such as formating the string and then converting the string to double but it doesn't work, still shows as 80.0. Can anyone help me with that?Thanks
For display purposes you can use string.format. I'm assuming this is currency related variable.decimal moneyValue = 80.0m;
string displayValue = String.Format("Total: {0:C}", moneyValue);
Console.WriteLine(displayValue); Dev
What I meant was converting string to decimal not ...
How can I count number of rows in each datawindow in composit datawindow then access and set item in each row in each datawindow! #2This is a multi-part message in MIME format.
------=_NextPart_000_0043_01C308EA.0E4861E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi friends,
I created a composite datawindow includes three datawindow. How can I
count the number of rows in each datawindow? (Rowcount() function can =
not
works). Also, I need access in each row then reset the value that I want =
in
each row in each datawindow. I use the property to access to get data in
each row in each datawindow, but the right value only happens in the =
fi...
convert string to numberHello, if I use the sprintf function it would give me a number STRING, but =
not number, so I have to trick the string to become number by adding and su=
btracting the number with 1. Is there a better way than this ? I want it to=
be a number data type and not string.=0A=0Ae.g =0A=0Amy $strNumber =3D spr=
intf("%04d", 123);=0Amy $number =3D $strNumber + 1 - 1; # to trick Perl to =
convert to number datatype instead of string. =0A=0A=0AThanks,=0A=0AWilliam=
=0A=0ASend instant messages to your online friends http://uk.messenger.yaho=
o.com
On Sun, Jun 15, 2008 at 8:09 PM, Wi...
Convert a String to a Number
How can i convert a character to a number, so that the result is only numerical digits, and would always be the same, besides 26 (plus non-alpha characters) if-then statements.
like, A = 1 and A always equals 1
so if I had the string: 1234A
after converting, I would get the result: 12341
A doesn't necessarily have to = 1, or even a single digit. It just has to equal a numerical... number.
perhaps you can do something like this.
Store your letters in an array A and maintain a cooresponding array B that has the numeric equivalent you would want to repla...
Convertion numbers to stringsHello!
I have some numbers in data type "Numeric". The task is to write expression
wich combines prefix, number and suffix. The number must have no spare
zero's on tale. Linke in example:
"NDS 20%"
"SN 1.5%"
"ANT 0.25%"
The slyboot server makes all the numbers with the same length of fract.
part. like "20.00000" and I couldn't cope with this for two weeks already.
I don't know of a way to do that in SQL Anywhere.
--
Jim Egan [TeamPS]
Dealer Solutions, Inc.
Houston, TX
See you at the Powersoft User Confer...
convert to string #2
i want to convert to string an integer value which i'm receving from database, in an SqlDataReader, how to do this?SHASHANK BHIDECAPGEMINI INDIA"THE ROAD TO SUCCESS IS ALWAYS UNDER CONSTRUCTION MARK MY RESPONSE AS ANSWER TO HELP ME BUILD IT :)"
you can use the toString() function.. for e.g. objreader["columnname"].toString() The real voyage of discovery consists not in making new landscapes, but in having new eyes
shashankgwl:i want to convert to string an integer value which i'm receving from database, in an SqlDataReader, how to do this? Hi,...
convert string to number?
Hi,
I have a problem where a number read from a file is being treated as a
string by perl (I think!). I am using the module RSPerl which is an
interface between Perl and the statistical language R. When i read a
column of numbers from a file and pass it to the perl/R function i get
an "invalid 'type' (character) of argument" error.
The reason i think this is a problem on the Perl side is shown by this
pseudocode:
while(<FILE>){
... stuff to extract $value from each row ...
push(@list1, $value);
}
@list2 = (100.2, 232.333, 344.2); # these ...
PowerBuilder DataWindow #2Hi all,
I have a requirement to implement a master-detail sheet. That's ok.
However, based on the user-logged-in credential, the user may OR may
not be able to edit the details part.
Now I can easily implement this by adding a constraint while updating
the details' data.
if user_can_edit then
update
end if
The problem is this:
If the user is not entitled to make changes, he is still able to put
focus to the details' form data and modify (of course I am not
updating it)...but the user can get a feeling "oh I am able to modify
the data".
Is it so...
Convert String to NumberI am running PB 7.03 build 10047 on Windows 2000.
How do I convert a string value to number in the DataWindow script?
I can convert number to string using String(ll_value), but how do I do the
reverse?
The help file says I should be able to use Number(ls_value), but the error
checker tells me that is an unknown function.
Thanks for your help.
dec('123') or long('123') or integer('123')
--
Kim Berghall
Sisu Group, Inc.
remove no_spam.
no_spam.kberghall@sisugrp.com
www.sisugrp.com
<Scott_Emery> wrote in message
news:72D1C6C14C517376005C20...
Converting a string to a number
Hello everyone, first post and all that, i got a bit of a problem.
First off, the DB information:
id: autonumber
score: text
Both these feilds in the database are numerical, however, the score is used as a text feild, the id an autonumber.
When i use a querystring to pass the score over to another page, so that the page produces only information with that perticular score matching, it works.
When i try to use the ID number, i get a case miss match.
I can only fathom that this is because its an autonumber. However, i need to keep the DB design as it is, as when i add a ne...
Convert a string to numberHi.
I want to set a value such as 1.5 or 10 to a text box in a report
datawindow at the run time. The value will come from the user before
he/she runs the report. How do I convert this string in the text box to
a number that will be used for further computation at the summary band?
I tried number() function, but it requires a real string and refuses to
accept a variable or a column name. Thanks in advance for any help.
Jian Kuang
If the value comes from the user, it would be in the form of a Retrieve
Argument. You can refer to the retrieve argument in the computed field for...
string to string[] #2
string[] strArray;while(dtardrUsrDet.Read())
{string strUsrEmail=dtardrUsrDet.GetValue(0).ToString();
int intDayDiff=System.Convert.ToInt16(dtardrUsrDet.GetValue(1).ToString());if(intDayDiff==45)
{
strArray=strUsrEmail;
}if(intDayDiff==30)
{
strArray=strUsrEmail;
}
how to store string values from reader into string arrayMark As Answer If my reply helped you.
Hi,
I am assuming that you want each string in an array, not each character as a separate string in a string array here....
The easiest way is to create an ArrayList, add each stri...
Converting a string to a filehandle #2Hello
I'm processing a file of test data that looks something like:
FH1,data1,data2,data3,...etc
FH2,data1,data2,data3,...etc
FH1,data1,data2,data3,...etc
Each line split into an array and processed.
The first element (FH1, FH2, etc) is the name of the filehandle the
output should be printed to.
I'm trying to do something like:
use strict;
use warnings;
open (FH1, ">file1");
open (FH2, ">file2");
open (INPUT, "<inputfile");
while (<INPUT>)
{
....split line
....process data
....create output
my $FH =3D...
Converting string to int #2
hi all!
is there a way to do that?
or a way to get the value of a dropdown list as an int? do forgive my bad spelling
Given a string variable s, use either
int i = Convert.ToInt32( s );
or
int i = Int32.Parse( s );
You can also use Int32.TryParse() as well.RegardsDave
Hi, use method Int32.Parse(string) or Int32.TryParse(string, out int).
For example:int id = 0;
if (int.TryParse(Request.QueryString["id"], out id)
{
// do something
}
else
{
// fix problem
}
Have a nice day,
R.rjichaprogrammer + caffeine + taurine = new application
mestrebisli : ...