ASP (c)

Source: Internet
Author: User

usingSystem;usingSystem.Collections.Generic;usingsystem.globalization;usingsystem.linq;usingsystem.threading;usingsystem.web;usingSystem.Web.UI;usingSystem.Web.UI.WebControls; public Partial classstrchange:system.web.ui.page{protected voidPage_Load (Objectsender, EventArgs E) {        //set the numeric value of a fractional part of currencyshowvalue.innerhtml = Getnumberformat ("134.12554",3); //format data for currency formatShowvalue.innerhtml + ="<br/>"+ Getformatnumber ("134.12554"); //Binary ConversionShowvalue.innerhtml + ="<br/> 10 Turn two:"; Showvalue.innerhtml+ = Convert.ToString (Ten,2); Showvalue.innerhtml+="<br/> 10 ext. eight:"; Showvalue.innerhtml+ = Convert.ToString (Ten,8); Showvalue.innerhtml+="<br/> 10 ext. 16:"; Showvalue.innerhtml+ = Convert.ToString (Ten, -); Showvalue.innerhtml+="<br/> II ext. eight:"; Showvalue.innerhtml+ = Convert.ToString (convert.toint64 ("1010",2),8); Showvalue.innerhtml+="<br/> II ext. 10:"; Showvalue.innerhtml+ = Convert.toint64 ("1010",2).        ToString (); Showvalue.innerhtml+="<br/> II ext. 16:"; Showvalue.innerhtml+ = Convert.ToString (convert.toint64 ("1010",2), -); Showvalue.innerhtml+="<br/> Eight turn two:"; Showvalue.innerhtml+ = Convert.ToString (convert.toint64 (" a",8),2); Showvalue.innerhtml+="<br/> eight ext. 10:"; Showvalue.innerhtml+ = Convert.toint64 (" a",8).        ToString (); Showvalue.innerhtml+="<br/> eight ext. 16:"; Showvalue.innerhtml+ = Convert.ToString (convert.toint64 (" a",8), -); Showvalue.innerhtml+="<br/> 16 Turn two:"; Showvalue.innerhtml+ = Convert.ToString (convert.toint64 ("a", -),2); Showvalue.innerhtml+="<br/> 16 ext. 10:"; Showvalue.innerhtml+ = Convert.ToString (convert.toint64 ("a", -),8); Showvalue.innerhtml+ = Convert.touint64 ("a", -).        ToString (); //confirm pop -up windowbutton1.attributes["OnClick"] ="return confirm (' Are you sure? ')"; }    Private stringGetnumberformat (stringStrintDeci) {        Doublevalue; stringReturnVal =""; if(Double. TryParse (str, outValue)) {numberformatinfo NFI=NewCultureInfo ("ZH-CN",false).            numberformat; NFI. Currencydecimaldigits=deci; ReturnVal= Value. ToString ("C", NFI); }        Else{returnval="the value is not correct! "; }        returnreturnval; }    Private stringGetformatnumber (stringStr) {        Doublevalue; stringReturnVal =""; if(Double. TryParse (str, outValue)) {numberformatinfo NFI=NewCultureInfo ("ZH-CN",false).            numberformat; NFI. CurrencyGroupSeparator=",";//sets the string in the currency to group the digits to the left of the decimal pointReturnVal = Value. ToString ("C", NFI); }        Else{returnval="the value is not correct! "; }        returnreturnval; }    protected voidButton1_Click (Objectsender, EventArgs E) {showvalue.innerhtml+="<br/> you clicked ok! "; }}

AC group: 225443677

ASP (c)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.