Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

C# convert random numbers in textBox to currency

int input = 40;
string output = $"{input:C2}";
Comment

C# convert random numbers in textBox to currency

public void textchange(object sender, EventArgs e)
{
   if(textbox1.Text.Contains("$"))
   {
     string valueToConvert = textbox1.Text.replace("$","");
     double newVal = Convert.ToDouble(valueToConvert);

     //Assign the new value with $ to textbox1
     textbox1.Text = "$"+Convert.ToString(newVal);
   }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how crate cron netapp 
Csharp :: webbrowser control feature_browser_emulation compatible 
Csharp :: c# .net stringify data query 
Csharp :: a infinite loop in text box update ui c# 
Csharp :: cancellationtoken.linkedtokensource c# example 
Csharp :: css text no word wrap 
Html :: lodash cdn 
Html :: href do nothing 
Html :: disable spell check html 
Html :: how to change a favicon in html 
Html :: multipart form 
Html :: center text v-card 
Html :: html new target 
Html :: html entity quote 
Html :: how to tab in html 
Html :: how to add favicon in html 
Html :: html img size 
Html :: angular click stop propagation 
Html :: html shell 
Html :: Hello World HTML Code Example 
Html :: html accept png and jpg 
Html :: alternative image in img tag 
Html :: textarea placeholder 
Html :: html lowercase 
Html :: html center button 
Html :: htaccess code to remove .php extension 
Html :: html center body 
Html :: html sound autoplay 
Html :: search icon html code 
Html :: align button right 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =