Hi Guys, If you have a Text Box which you are putting in the Decimal Places such as "15.50". Then Submitting this to a Access Database then on re-fresh the data shows in the grid view as "15.5". Where abouts should this be modified so that it shows Decimal Places? Is it on the Access DB Layout and how it's store or should there be come amendment on the code side? It looks like the GridView is removing the trailing '.00's' ?? Many thanks for any help.

Member Avatar
Member Avatar
+0 forum 11

I have problems cleaning up a couple of input field. I've been pecking away at this issue since I wrote the application about 18 months ago. When I think I have it cleaned up; it pops up again, when users violate rules (as they often will do) and the extra spaces and tabs show up. I have a form that is filled via Copy from an excel file (this is a requirement) and pasted into the textarea: <textarea name="header_fields" cols="60" rows="6"><?php if(!empty($error)) {echo $varAllText;} ?></textarea> When the form is processed, the field is received via the following: $varAllText = trim($_POST['header_fields']); …

Member Avatar
Member Avatar
+0 forum 1

I need help with my homework assignment. The assignment is write a method DisplayDigits that receives an integer between 1 and 99999 and displays it as a sequence of digits, separating each pair of digits by two spaces. For example, 4562 should appear as 4 5 6 2 I have tried several ways but all of them failed. I'm new to C#. *Attempt 1.* static void Main() { int numbers; Console.Write("Enter a number between 1 and 99999: "); numbers = Convert.ToInt32(Console.ReadLine()); DisplayDigits(numbers); } public static void DisplayDigits(int numbers) { int digit1, digit2, digit3, digit4; while ((numbers / 1) % 10 …

Member Avatar
Member Avatar
+1 forum 3

I'm writing a program in .asm which prompts the user to enter a sentence. I have no problems with this but one requirement of the program is to change the format of the sentence by replacing all the spaces (" ") with underscore characters ("_"). How do I go about singling out the spaces and the changing them?

Member Avatar
Member Avatar
+1 forum 5

Hi I have code I use to look up data from mysql, then dispaly in text boxes. For some reason ALL my data drops the words and spaces Example: if a supplier name is "DyFin (Pty) Ltd" the text box only displayes "DyFin" Example: If My phone numbers are "0860 555 2350" the text box shows me "0860" I have messed through my code to get this to work but im lost now: <select name="select" onChange="window.location='add_doc.php?supplier='+this.value" > <?php $its = $_GET["supplier"]; if($its == 0) { $sql="SELECT * FROM supplier"; $result=mysql_query($sql); $options=""; echo "<OPTION VALUE=\"0\">"."Select Supplier"; while ($row=mysql_fetch_array($result)) { $id=$row["id"]; $supp=$row["supplier_name"]; …

Member Avatar
Member Avatar
+0 forum 2

I need to create a palindrome tester program that ignores spaces, punctuation and uppercase/lowercase to determine if the string given to the user is a palindrome (same beginning to end as end to beginning). HERE'S WHAT I HAVE SO FAR: String str, another = "y"; int left, right; Scanner scan = new Scanner(System.in); while(another.equalsIgnoreCase("y")) { System.out.println("Enter a potential palindrome: "); str = scan.nextLine(); left = 0; right = str.length() - 1; while(str.charAt(left) == str.charAt(right) && left < right) { left++; right--; } System.out.println(); if(left < right) System.out.println("That string is NOT a palindrome."); else System.out.println("That string IS a palindrome."); System.out.println( ); …

Member Avatar
Member Avatar
+0 forum 3

Hello, Please advise how to remove white spaces before and after a sentence only. Example: " This is a sentence. " should be "This is a sentence." Thanks.

Member Avatar
Member Avatar
+0 forum 3

Hi All, I have to split a text into words using both spaces and punctuation as delimiters. Punctuation includes characters like .,!?:;'"- I am using the split function as it follows: [CODE]wordsArray = strLine.split("[.,!?:;'\"-]+\\s*");[/CODE] However, this only splits my text by spaces and ignores other characters I've set as delimiters. Obviously, I am new at regexes and I could use your help. Thank you.

Member Avatar
Member Avatar
+0 forum 4

Im making this program that reads in a java file and creates a new file with a formatted version of the file. Basically every place there is a { open braces, I want to add 4 spaces to each lines after that etc.. Here is what I have so far.. import java.util.*; import java.io.*; public class Indent{ public static int SPACES = 0; public static void main(String[]args) throws FileNotFoundException{ Scanner sc = new Scanner(System.in); String fileN = setFile(sc); Scanner jfile = new Scanner(new File(fileN)); String newTemp = fileN.substring(0,fileN.length()-5)+"Indented.java"; PrintStream output = new PrintStream(new File(newTemp)); while(jfile.hasNextLine()){ String text = jfile.nextLine(); fileFixed(text,output); …

Member Avatar
Member Avatar
+0 forum 7

I have a variable [ICODE]$topic = $POST_['topic'][/ICODE] that is entered by the user, it can possibly have spaces. I want to create a table based on this variable. Right now the code creates the table but only uses the first word. [CODE] $create="Create TABLE $topic (I know this part works)"; mysql_query($create); [/CODE] I tried adding single quotes to [CODE] $create="Create TABLE '$topic' (I know this part works)"; mysql_query($create); [/CODE] but it still only uses the first word to create the table. any suggestions?? Sorry for the lack of code but im at work right now so i can't remember the …

Member Avatar
Member Avatar
+0 forum 1

Hi, Thank you for your help in advance, i am trying to create a dictionary, the code below works fine if I have two columns in each row with no spaces, however one of the columns data natively has spaces in it e.g. Sarah me hy uuuuu at the moment it works if I do Sarah me_hy_uuuuu However this isnt perfect for us. How do I get python to break the data into two columns based on only the first space? [CODE]fname = r"C:\blah3.txt" A_dict = {} for line in open(fname): name, score = line.split() A_dict[name] = str(score) print (A_dict)[/CODE] …

Member Avatar
Member Avatar
+0 forum 4

Im a beginner in C,Can anyone help me? :?: I have problems when I encounter double or multiple spaces between words. [CODE] #include <stdio.h> FILE *fpr; int main(int argc,char *argv[]) { if ((fpr = fopen(argv[1],"r")) == 0) { printf ("\nFile %s Don't Exist!\n", argv[1]); } fprintf (fpr,"%d",count()); return(0); } count() { char ch; int word=0; while(feof(fpr) == 0) { ch= getc(fpr); if(ch == ' ') { word++; } else if(ch == '\n') { word++; } } printf("Number of Words : %d\n",word); } [/CODE] Thank You :)

Member Avatar
Member Avatar
+0 forum 6

I need to write a program where the user enters a paragraph, the program reads in, stores every fifth word in a separate bank (array), and outputs the paragraph with the fifth words removed and replaced with 15 spaces. As usual, I finished the code, edited repeatedly, and can't find my error.... Help?!!! [CODE] TYPE INPUTS = ARRAY[1..45] OF STRING; FIFTHWORDS = ARRAY[1..45] OF STRING; VAR CHECK5 : REAL; FIFTHWORD : FIFTHWORDS; {ARRAY OF MISSING WORDS} STRLEN : INTEGER; {READS LENGTH OF STRING W/O MISSING WORDS} FIFTEENSPACE : STRING; {FILLER} WORDCOUNT : INTEGER; NUM5WORDS : INTEGER; {AMOUNT OF 5TH WORDS} …

Member Avatar
+0 forum 0

Ok, so I want to create an alternate way of creating this: *________* **______** ***____*** ****__**** ********** ****__**** ***____*** **______** *________* Note: The right side is supposed to lookjust like the left side. Note 2: Replacing the underscores with asterisks(*) This is the code I have so far, but I want to know of other ways to do it, I`d be grateful if you helped me. #include <iostream> #include <string> #include <sstream> #include <algorithm> #include <iomanip> using namespace std; const char symbol('*'); const char space(' '); int main(int argc, char *argv[]){ string in; stringstream ss; int n, x; x=1; do …

Member Avatar
Member Avatar
+0 forum 1

I would like to know to remove spaces from start and end of a string without removing the middle space. Ex. _ _String _ Sample _ _ = String sample I have a code: [CODE]Text1.text = Replace(Text1, " ", "")[/CODE] The code removes all the space in a text. Ex. _ _String_Sample_ _ = StringSample I want the middle space to remain. Only the first and the last space will be removed.

Member Avatar
Member Avatar
+0 forum 4

Hi everyone, So i have the following code which is used so i don't have to have .php at the end of my files and also more importantly to view members profiles by having there username after my domain. Unfortunately if the user has a space in their name you get a 404. Here's the code from .htaccess: [B]RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php RewriteRule ^([a-zA-Z0-9_-]+)$ viewuser.php?user=$1[/B] Basically, i'm just wondering if anyone knows if there is a way around it without taking the space away from everyones' username. Thanks in Advance!, Daniel

Member Avatar
Member Avatar
+0 forum 2

Hello, I have a a problem copying individual words inside 2D array. Array is dynamically created and initializes perfectly, but as soon as i call my function, and if i have 2 or more spaces between the words, its copying the spaces inside the next index element of the array. Am I missing something? Any help is appreciated! Thank you [code=c] void strToArray(char** my2D_Container, char* my_String){ int j = 0; int p = 0; for (int i = 0; my_String[i]; i++) { j = 0; while ((my_String[i] != 32 && my_String[i] != '\n') && my_String[i]) { my2D_Container[p][j++] = my_String[i++]; } …

Member Avatar
Member Avatar
+0 forum 1

Hello, I have a problem, I needed a change from C++ to C#. help anyone? I made it from this: ( This is script in C++ [CODE]using namespace System; using namespace System::Text; using namespace System::Net; using namespace System::Net::Sockets; String^ chr(String^ str) { Char^ c = Convert::ToChar(Convert::ToInt32(str)); return Convert::ToString(c); } Int64^ ord(String^ value) { System::Char^ c = System::Char(value[0]); return Convert::ToInt64(c); } ref class RemoteAdminException : Exception { public : String^ Exception; RemoteAdminException(String^ ex) { Exception = ex; } String^ GetError(void) { return Exception; } }; public ref class RemoteAdmin { public: String^ add; String^ pw; int port; UdpClient^ udpClient; property String^ …

Member Avatar
Member Avatar
+0 forum 1

Hi, I have an urgent ugly problem. I have a php file on a server that reads the name of the files of a directory from the server and POST them to my java application. When I try to read it, i get [CODE]Server returned HTTP response code: 400 for URL: http://www.xxxxxxxxxxxxx[/CODE]. This does not happens on files that do not contain white spaces. Only at URLs like: "http://www.abc.com/Hello world.gif" but not at "http://www.abc.com/HelloWorld.gif". I tried to encode the URL... I could not solve it. Please can you help me? I need it fast... Thanks!

Member Avatar
Member Avatar
+0 forum 3

The End.