Convert decimal to string

I need to put a decimal field into a message box.  I converted it to
string, and it shows about 10 decimal places. I only want the user to
see 2 decimal places to the right of the decimal.

Connie Phillips
phillips.connie@bsc.bls.com
0
Connie
12/3/1997 8:39:12 PM
sybase.powerbuilder.general 62418 articles. 17 followers. Follow

2 Replies
4042 Views

Similar Articles

[PageSpeed] 30

use mid to find the decimal then left() to chop off > 2 places beyond it..
..02

Connie Phillips wrote in message <3485C370.4886@bsc.bellsouth.net>...
>I need to put a decimal field into a message box.  I converted it to
>string, and it shows about 10 decimal places. I only want the user to
>see 2 decimal places to the right of the decimal.
>
>Connie Phillips
>phillips.connie@bsc.bls.com


0
forums
12/3/1997 9:33:18 PM
On Wed, 03 Dec 1997 15:39:12 -0500, in
powersoft.public.powerbuilder.general Connie Phillips
<phillips.connie@bsc.bellsouth.net> wrote:

>I need to put a decimal field into a message box.  I converted it to
>string, and it shows about 10 decimal places. I only want the user to
>see 2 decimal places to the right of the decimal.

Connie,

You can use the second optional argument to specify the number of
decimal places:

String(10.9999999,"#,##0.00")

HTH,
--
Boris Gasin [TeamPS]	
mailto:bgasin@advent2000.com

Have a heart,
http://home.sprynet.com/sprynet/JCredit/eds_stry.htm
0
bgasin
12/3/1997 9:58:13 PM
Reply:

Similar Artilces:

Convert string to decimal
I have strings like this: 0.8933 - 0.7733 - 1.2234I notice that the ones that are 0.xxx and near to 1, they are round up to 1.0000 when I convert the strings to decimal.I need them to remain the same value as decimal to insert them in the db.How can I achieve it and avoid rounding?Many thanks. Use decimal.Parse. Look at the following example page: aspx: <asp:TextBox runat="server" ID='txtNumber'></asp:TextBox><asp:Button runat="server" ID='btnExecute' Text='execute'          &nb...

Converting decimal to string
Hi, I need to convert a decimal number to a string local-formatted. For example, number 1234.56 should be converted in a string "1.234,56" when program runs with Italian international settings. The problem was born settings the initial value for a decimal dw column with formatted edit mask. Thanks. Marco In script, the String function will do that based on the Windows regional settings. On Sat, 8 Dec 2001 23:16:20 +0100, in powersoft.public.powerbuilder.powerscript Marco Sarti <marco.sarti@nospan.xx> wrote: >Hi, > >I need to convert a decim...

convert string to decimal
Hi, I'm not sure how the PB function DEC interprets strings to convert them to decimals. Is the interpretation of "." and "," everytime american or dependent on some settings? TIA Chris Werner It depends on what you define as a decimal separator in your regional settings. HTH, Davy "Chris Werner" <cw[please_no_spam]@f-s.de> wrote in message news:4146a161@forums-1-dub... > Hi, > > I'm not sure how the PB function DEC interprets > strings to convert them to decimals. Is the > interpretation of ".&...

convert a string to nullable decimal
HiI I have a property and need to convert the value in textbox to nullable decimal. ThankSpublic decimal? getMyValue { get {return (this.amount.Text); } set {this.amount.Text = value; }   }  This is a possible solution. But I think you will get problems if you set the string value to null:        decimal? value = null;                                string x = "message"; ...

A stupied Question in Converting String to Decimal
Edited by haidar_bilal - Please place your code within < code > and < /code > tag. Thank you. Hi experts, I am having problem in "converting String to Decimal." I worte a simple function that gets values from text boxes. It makes a calculation and returns a value. The code is written below. The funny thing is whent I enter values 1, xxxx, 4 , it returned 96, but when I tried 1, xxxx, 4.5 I have got "Cast from string "4.5" to type 'Decimal' is not valid." error. How do we convert String to Decimal? please help me Exception De...

How to convert string to decimal format in a streamreader?
Edited by SomeNewKid. Please post code between <code> and </code> tags. Hi all, I have to read from a text file and generate some values and save to database. But first of all, I received an error "Input string was not in a correct format" on sEfundAmt = Convert.ToDecimal(Convert.ToInt64(Mid$(sRetLine, 30, 10))) / 100.0 For example, in the text file, value is '0000150776', and I want to convert it to 1507.76, how to do it? Thank you. Here is the partial code: ----------------------------------------------------------- Dim sr ...

Convert from string to decimal/float/double
 I need to insert a decimal/float/double value into a SQL Server table.The numbers are coordinates for GoogleMaps, and are represented like this:Lat: 55.4356765 and Lon: 12.3857684 (just an example)The numbers are read from a textbox into a business object which is then inserted intothe table. The properties for the numbers in the object are set to decimal. In the code behind, where the textbox values are read into the object, I convert themfrom string to decimal. TextBox _lat = (TextBox)GoogleMapFormView.FindControl("Latitude");TextBox _lon = (TextBox)GoogleMapFormView.FindCo...

Decimal separator and convert string in double
Hello everybody. I have a simple problem, but it's dificult for me to solve it. Suppose, my decimal separator define in control panel is ",". If I define a string equal to "145.22" and convert it in a double, the return double value is 145 ! The decimal part isn't exist ! But if the string is equal to "145,22", the return double value is zero ! Now, suppose another time, I define in control panel the decimal separator equal to ".". If I define a string equal to "145.22", then the return double value is zero ! If I define...

Failed to convert parameter value from a String to a Decimal.
Hi there   Above error occurs because of the followingVeh_myCommand.Parameters.Add("PurchasePrice", SqlDbType.Money).Value = txtStep5_PurchaseDate.Text Veh_myCommand.Parameters.Add("RetailPrice", SqlDbType.Money).Value = txtStep5_RetailPrice.Text   I am putting in numbers such as 2000 or 10000 I have no decimal points added   any assistance would be greatly appreciated Thanks :) If you specify the SqlDbType, then you must make sure the value you are trying to assign is a compatible type. You can use double type which can be used with money. Veh_...

Convert string to string array.
Hi, We have a string array argument in datawindow object for 'IN' sql statement. Our user enter a string in a single line edit. How to convert the string to a string array for the argument of datawindow? ex. user input : 'A', 'B', 'C' => str_arr[]={'A', 'B', 'C'} dw_1.retrieve(str_arr) Thanks in advance. Take a look at the n_cst_string object in the pfc. It has a method called of_ParseToArray that does exactly what you're looking for. It's a pretty simple task to 'port' the code ...

convert octet string to string
I'm trying to use IDM 3.5.1 provision an AD environmnet with users from eDir. We wanna provision as much info as possible, but one attribute gives us headaches. This is an auxiliary attribute associated with each user in eDir that has it's syntax set to octet string. Problem is we need to provision this over to another attribute in AD that uses string as its syntax. Is thee a way through XPath or ECMA script to have the value converted during the provisioning? I've no experience with either XPath or ECMA so please be detailed in your replies. Thx -- jdoeconsu...

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 ...

Converting a list of string into string
When I try the following code in Prism I get the error "Error 8 (CE15) Type mismatch, cannot assign array of System.String to System.String " ***************************************************************** var mobileNumberList :List<string> mobNumberArray :string Begin mobileNumberList.add('1234567890'); mobNumberArray := mobileNumberList.ToArray();//error here end; *************************************************************** What needs to be done to convert an array of strings to a string Venkatesh Venkatesh VT a écrit : > When I...

How to convert a String into a UTF8 String
Hello! I want to convert a normal String into a UTF8 String for example:myString = BüromyUTF8String = Büros  I dont know how to do this. In PHP you can do this with myUTF8String = utf8_encode(myString) Thank you for all hints! try this string test ="ÁÉÍÓÚ áéíóú àèìòù äëïöü Ññ €"; byte[] a= System.Text.Encoding.UTF8.GetBytes(test); string test2= System.Text.Encoding.UTF8.GetString(a);  greetingsBest Regards,Sebastián DopicoBlog Desarrollador Thank you Sebastián! If I make it like that - test2 looks the same as test.But I think my problem is solved. (Someone tol...

Web resources about - Convert decimal to string - sybase.powerbuilder.general

List of converts to Buddhism - Wikipedia, the free encyclopedia
Ajahn Brahm (born 1951), Religious teacher and student of the late Thai monk Ajahn Chah . Currently he is the abbot of the Bodhinyana Monastery, ...

Facebook Timeline For Pages: 8 Million Converts, 29 Million To Go
... reach to 98 percent of users who liked its page, as well as to double its engagement rate, during a 28-day period. Dr. Pepper hasn’t yet converted ...

Facebook stock roundup: Execs offload more stock, directors convert shares
... Bowles, the former co-chair of the now-defunct National Commission on Fiscal Responsibility and Reform, and Reed Hastings, Netflix CEO, converted ...

How to Convert Leads Into Buying Customers - The 9 Step Sales Process EVERYONE Should Use
... School of Business in Toronto on the topics of Sales and Entrepreneurship. I shared with them the sales process that I find How to Convert Leads ...

Bitcoin : Should I convert my savings to Bitcoin?
Answer (1 of 7): You should think of this question as "Should I invest all my savings in Bitcoin?", and not "Should I have my savings denominated ...

Coordinates - Calculate and Convert a Position on the App Store on iTunes
Get Coordinates - Calculate and Convert a Position on the App Store. See screenshots and ratings, and read customer reviews.

Catholics should not convert Jews, says Vatican, in push against anti-Semitism
... 50 years since the Vatican's repudiation of the concept of Jewish guilt for Jesus' death.  Vatican City: Catholics should not try to convert ...

Today’s apps gone free: BlockBear, Stock Grader, PDF Smart Convert and more
Block ads and other annoying content, take the emotion out of investing, and convert almost anything into a PDF with todays collection of apps ...

Ford patents rear wheel that converts into a unicycle
Filed under: Government/Legal , Green , Ford , Green Driving , Motorcycle , Electric Ford is thinking about allowing drivers to remove a rear ...

How to convert your old VHS tapes to DVD with this software
Remember those old VHS tapes you have sitting in the corner? Convert them into DVDs with this affordable software so you can easily watch them ...

Resources last updated: 1/19/2016 7:58:14 PM