草庐IT

double-submit-prevention

全部标签

flutter - 如何将文本 Controller 的输入作为 double 输入? - flutter

我有一个文本Controller,需要将文本Controller值传递给一个类的参数,该类只接受double作为输入,但默认情况下文本Controller的类型是字符串。文本Controller:TextEditingControllerpriceController=TextEditingController();...child:TextField(controller:priceController,keyboardType:TextInputType.number,autofocus:true,),传入值gopriceController给只接受double值的参数:Level

string - 用 add 0.1 计算 double 给出了点后面的很多数字

我在Flutter中使用Double进行计算时遇到问题。这是我的代码:双倍深度=0.5;RoundIconButton(icon:FontAwesomeIcons.plus,onPressed:(){setState((){depth=depth+0.1;});},),结果出现在文本字段中Text(depth.toString(),style:kBigTextstyle,),当我按下加号按钮时,它显示:0.6然后0.7然后079999999999999但必须是0.8depth=depth+0.10000;双倍深度=0.5;RoundIconButton(icon:FontAwesome

flutter - 如何显示 double 到 2 个小数点?

这个问题在这里已经有了答案:What'sthedifferencebetweendouble.toStringAsFixedandtoStringAsPrecisionindartlang?(1个回答)关闭3年前。如何显示或保留2个小数点的double值?textContent:'TotalPayable:'+'€'+finalPrice.toString(),我需要知道如何确保doublefinalPrice;finalPrice始终显示到2个小数点。是否转为字符串。我已经尝试了所有方法并调用我的国session员。doublefinalPrice=0.00;我注意到将它初始化为0.

json - 在 Flutter 和 Dart 中从 JSON 解析 double 值

我在尝试从Flutter中的JSON获取double值时遇到问题。classMapPoint{Stringtitle;doublelat;doublelng;MapPoint({this.title,this.lat,this.lng});factoryMapPoint.fromJson(Mapjson){returnMapPoint(title:json["title"]asString,lat:json["lat"]asdouble,lng:json["lng"]asdouble);}}由于某些原因我得到了错误DartError:Unhandledexception:type'do

Dart或Flutter如何读取一个float32 little endian编码的二进制文件并转换成List<double>?

我正在使用file.readAsBytes()。但它只提供List来接收数据。我正在尝试Uint8List但没有用。 最佳答案 readAsBytes将为您提供字节列表。它可能是一个Uint8List或者可能只是一个List.(如果不是Uint8List,使用Uint8List.fromList(anotherByteArray)转换它。)然后使用:ulist.buffer.asFloat32List() 关于Dart或Flutter如何读取一个float32littleendian编码

dart - 如何在 Dart 中拆分 Double 值?

我想将两个变量分配给double上的整数和小数部分。怎么做? 最佳答案 一种方式是intx=abc.toInt()inty=int.tryParse(abc.toString().split('.')[1]); 关于dart-如何在Dart中拆分Double值?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/55160793/

google-api - 使用 double.parse() 在 Dart 中将字符串转换为 double

我正在尝试转换从GoogleGeo返回的坐标。API成double。返回的响应的简化部分是...{locationData:{bounds:{northeast:40.222222,southwest:38.265987}}}当我使用print(locationData['bounds']['northeast'])时,我的控制台读取并理解该值为40.222222但是,当我尝试使用解析方法时,出现以下错误:varneLat=double.parse(locationData['bounds']['northeast']);I/flutter(10537):type'double'isn

java - 为什么android SQLite可以将 double 值(java 8字节)存储到浮点列中

CreateTable:db.execSQL("CREATETABLE"+PERSONS_TABLE+"("+PersonsColumns.ID+"INTEGERPRIMARYKEYAUTOINCREMENT,"...+PersonsColumns.HEIGHT+"FLOAT,"+PersonsColumns.CITY+"STRING);");WriteData:ContentValuesvalues=newContentValues();alues.put(PersonsColumns.HEIGHT,1.7976931348623157E308);db.insertOrIgnore(

entity-framework - 为什么 "real"和 "float"都映射到 "Single"而不是 "Double"?

我在模型优先模式(=EDMX)中使用System.Data.SQLite1.0.90与VS2013和EntityFramework5。我创建了一个包含表的新SQLite数据库:CREATETABLE[..][Test1integer]integer,[Test2int]int,[Test3smallint]smallint,[Test4tinyint]tinyint,[Test5bigint]bigint,[Test6money]money,[Test7float]float,[Test8real]real,[Test9decimal]decimal,[Test10numeric18_

swift - 在 swift 中比 double 更精确

Swift中是否有比Double更准确的float?我知道在C中有longdouble,但我似乎无法在Apple的新编程语言中找到它的等价物。如有任何帮助,我们将不胜感激! 最佳答案 是的,有!Float80正是为此而设计的,它存储80位(duh),10个字节。您可以像使用任何其他浮点类型一样使用它。请注意,Swift中有Float32、Float64和Float80,其中Float32只是的类型别名Float和Float64是Double 关于swift-在swift中比double更