decimal-point

VBA dots from database get loaded into textbox as comma

我只是一个虾纸丫 提交于 2019-12-23 22:52:51
问题 I know the Headline sounds odd so I will start off with a screenshot: As you can see, the problem is that the point suddenly changes to a comma when I look up an ID in the UserForm. Before recalling Infos, I am saving all Information rather straightforward: with ws Range("BH" & lastRow).value = Me.payinfoOnTime Range("BI" & lastRow).value = Me.payinfo30 Range("BJ" & lastRow).value = Me.payinfo60 Range("BK" & lastRow).value = Me.payinfo90 Range("BL" & lastRow).value = Me.payinfo90more End with

Access insert numeric with decimal comma into Postgresql

浪子不回头ぞ 提交于 2019-12-23 19:53:06
问题 I need to insert on orderline into a linked PostgreQL table using Access VBA. For easy reporting, I decided to include the netto price which is a Numeric 18,2 field. My computer has a Belgian period using comma as decimal separator. i.e. 0.8 is represented as 0,8 This is the problematic part if the insert statement mijnSQL = "INSERT INTO tblOrderLijnen (OrderID, Nettoprijs )" mijnSQL = mijnSQL & " VALUES (" & NieuwOrderId& "', " & MijnTempOrderLijn!Prijs * ((100 - Korting) / 100) & ");" The

How to get the numbers after the decimal point? (java) [duplicate]

青春壹個敷衍的年華 提交于 2019-12-21 03:15:05
问题 This question already has answers here : How do I get whole and fractional parts from double in JSP/Java? (17 answers) Closed 6 years ago . double d = 4.321562; Is there an easy way to extract the 0.321562 on it's own from d? I tried looking in the math class but no luck. If this can be done without converting to string or casting to anything else, even better. 回答1: Well, you can use: double x = d - Math.floor(d); Note that due to the way that binary floating point works, that won't give you

Convert decimal number to vector

放肆的年华 提交于 2019-12-20 06:25:14
问题 In matlab I want to convert this: 12345.6788993442355456789 into a vector [1 2 3 4 5 6 7 8 8 9 9 3 4 4 2 3 5 5 4 5 6 7 8 9] I have found several solutions to convert a integer into a vector using commands like scanf, num2str,... but those don't fit with non-integers, and some solutions have problems with numbers with a large number of decimal places... That kind of conversion is needed because I want to see and use all of the digits of the number. 回答1: What input source are you getting those

How to display a fixed number of digits in C++ without rounding

末鹿安然 提交于 2019-12-19 17:46:09
问题 I have this code (very basic): #include <iostream> #include <iomanip> using namespace std; int main() { float a = 0.0, b = 0.0, c = 0.0; cout<<"Input a: "; cin>>a; cout<<"input b: "; cin>>b; cout<<endl; c = a / b; cout<<"Result: "<<fixed<<setprecision(2)<<c<<endl; return 0; } When I enter two numbers (say, a = 513 and b = 791) I get 0.65. Calculator shows that the correct answer is 0.648. I understand that my code rounds up the last decimal number but this is not what I want. How can I get it

How can I limit the number of decimal points in a UITextField?

ぐ巨炮叔叔 提交于 2019-12-17 09:21:11
问题 I have a UITextField that when clicked brings up a number pad with a decimal point in the bottom left. I am trying to limit the field so that a user can only place 1 decimal mark e.g. 2.5 OK 2..5 NOT OK 回答1: Implement the shouldChangeCharactersInRange method like this: // Only allow one decimal point // Example assumes ARC - Implement proper memory management if not using. - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *

convert decimal mark

扶醉桌前 提交于 2019-12-17 02:37:10
问题 I have a CSV file with data reading that I want to read into Python. I get lists that contain strings like "2,5" . Now doing float("2,5") does not work, because it has the wrong decimal mark. How do I read this into Python as 2.5 ? 回答1: float("2,5".replace(',', '.')) will do in most cases If value is a large number and . has been used for thousands, you can: Replace all commas for points: value.replace(",", ".") Remove all but the last point: value.replace(".", "", value.count(".") -1) 回答2:

How to change the decimal separator of DecimalFormat from comma to dot/point?

依然范特西╮ 提交于 2019-12-16 20:15:32
问题 I have this little crazy method that converts BigDecimal values into nice and readable Strings. private String formatBigDecimal(BigDecimal bd){ DecimalFormat df = new DecimalFormat(); df.setMinimumFractionDigits(3); df.setMaximumFractionDigits(3); df.setMinimumIntegerDigits(1); df.setMaximumIntegerDigits(3); df.setGroupingSize(20); return df.format(bd); } It however, also produces a so called grouping separator "," that makes all my values come out like this: xxx,xxx I do need the separator

PHP: rounding a number into 16 decimal digits

不羁的心 提交于 2019-12-13 14:18:03
问题 Hi I'm trying to rounding a number into the 16 decimal digits but it only show and doesn't round up till 14 decimal digit . Here's my attempt: <?php $num= 0.16346153846153846; $round = number_format((float)$num, 17, '.', ''); echo $round * -1; ?> OUTPUT: -0.16346153846154 EXPECTED OUTPUT: 0.1634615384615385 I know that float is only 14 decimal digits. Is there any other way around for the 16 decimal digits ? 回答1: You can set this parameters at run-time. 16 digits is usually the maximum value

Why is my program only printing to 6 decimal places?

你离开我真会死。 提交于 2019-12-13 00:57:40
问题 Ive created a program to compute the value of an integral from zero to infinity, however when i go to print my answer it only prints it to 6 decimal places, could someone advise on why this is? Thanks very much in advance :) #include <stdio.h> #include <math.h> #include <float.h> double integral_Function(double x){ double value; value = 1/((1+ pow(x, 2))*(pow(x, 2/3))); return value; } double trapezium_Rule(double lower, double upper, int n){ double h; double total; h = (upper - lower)/n;