decimal

Netbeans using comma as default. Why?

时光怂恿深爱的人放手 提交于 2021-02-10 20:26:15
问题 Hello guys and girls, So, Netbeans (like most IDE's) use dots (.) to organize decimal places, right? I dont know why but my IDE began to use comma (,) to organize decimal places... even the outputs showed in the console are using commas. How can i change it back to default settings and start using dot in decimal places again? PS: When i try to enter a number using dot and the decimal places (4.5, for example) i get this error message: Exception in thread "main" java.util

How to convert decimal time to time format [duplicate]

这一生的挚爱 提交于 2021-02-08 06:56:23
问题 This question already has an answer here : Outputting difftime as HH:MM:SS:mm in R (1 answer) Closed 3 years ago . I would like to calculate the difference between two time-sets. I can do this, but I only get the difference in decimals and I would like to know how to convert them to format as in "Minutes:Second". So, I have the minutes and the seconds as characters: video_begin <- c("8:14", "4:47", "8:27", "4:59", "4:57", "7:51", "6:11", "5:30") video_end <- c("39:08", "47:10", "49:51", "44

converting string to decimal in c#

北城以北 提交于 2021-02-08 02:12:47
问题 I am having some problems converting string to decimal values with decimal.parse. This is the line of code I have: fixPrice = decimal.Parse(mItemParts.Groups["price"].Value.Replace("$", "").Replace(" ", "").Replace("usd", "")); The value from which I am trying to convert is: '$779.99' Then once the parsing to decimal happens, I am getting this value: 77999. I would like to get 779.99 instead of 77999. Thanks in advance, Laziale Regex included: "@"\[^\""]+?)\""[^~]+?\]+?src=\""(?[^\""]+?)\""[^

converting string to decimal in c#

浪尽此生 提交于 2021-02-08 02:03:48
问题 I am having some problems converting string to decimal values with decimal.parse. This is the line of code I have: fixPrice = decimal.Parse(mItemParts.Groups["price"].Value.Replace("$", "").Replace(" ", "").Replace("usd", "")); The value from which I am trying to convert is: '$779.99' Then once the parsing to decimal happens, I am getting this value: 77999. I would like to get 779.99 instead of 77999. Thanks in advance, Laziale Regex included: "@"\[^\""]+?)\""[^~]+?\]+?src=\""(?[^\""]+?)\""[^

How to print/convert decimal floating point values in GCC?

倖福魔咒の 提交于 2021-02-07 14:22:20
问题 The GCC docs describe limited decimal floating point support in recent GCCs. But how do I actually use it? For example on Fedora 18, GCC 4.7.2. A simple C program like int main() { _Decimal64 x = 0.10dd; return 0; } compiles (when using -std=gnu99) - but how do I actually do other useful stuff - like printing _Decimal64 values or converting strings to _Decimal64 values? The docs talk about 'a separate C library implementation' for (I assume) things like printf - which additional library do I

NumPy: convert decimals to fractions

寵の児 提交于 2021-02-07 07:37:32
问题 I compute the reverse of matrix A , for instance, import numpy as np A = np.diag([1, 2, 3]) A_inv = np.linalg.pinv(A) print(A_inv) I got, [[ 1. 0. 0. ] [ 0. 0.5 0. ] [ 0. 0. 0.33333333]] But, I want this, [[ 1. 0. 0. ] [ 0. 1/2 0. ] [ 0. 0. 1/3]] I tried np.set_printoptions , import fractions np.set_printoptions(formatter={'all':lambda x: str(fractions.Fraction(x))}) print(A_inv) but I got this, [[1 0 0] [0 1/2 0] [0 0 6004799503160661/18014398509481984]] How do I convert decimals to

Converting decimal to binary in assembler

好久不见. 提交于 2021-02-05 12:17:25
问题 I need help with my first program in assembler. I have to convert values entered by user from decimal to binary. I have no idea how can I show values as a decimal, and what should I do next. could anyone instruct me step by step what do next. .model small .stack 100h` .data txt1 db "Enter binary value:" ,10,13, "$" txt2 db "BIN: " ,10,13, "$" .code main proc mov ax, @data mov ds, ax ;clear screen mov ah,0fh int 10h mov ah,0 int 10h ;show first text mov ah, 9 mov dx, offset txt1 int 21h call

Converting decimal to binary in assembler

不打扰是莪最后的温柔 提交于 2021-02-05 12:16:31
问题 I need help with my first program in assembler. I have to convert values entered by user from decimal to binary. I have no idea how can I show values as a decimal, and what should I do next. could anyone instruct me step by step what do next. .model small .stack 100h` .data txt1 db "Enter binary value:" ,10,13, "$" txt2 db "BIN: " ,10,13, "$" .code main proc mov ax, @data mov ds, ax ;clear screen mov ah,0fh int 10h mov ah,0 int 10h ;show first text mov ah, 9 mov dx, offset txt1 int 21h call

Translation from binary into decimal numbers in C++

两盒软妹~` 提交于 2021-02-05 08:10:30
问题 I tried to build a function that calculates a binary number stored in a string into a decimal number stored in a long long . I'm thinking that my code should work but it doesn't. In this example for the binary number 101110111 the decimal number is 375 . But my output is completely confusing. Here is my code: #include <string> #include <stdio.h> #include <math.h> #include <iostream> #include <string.h> int main() { std::string stringNumber = "101110111"; const char *array = stringNumber.c_str

Why is Binary represented as a String?

我只是一个虾纸丫 提交于 2021-02-05 07:12:07
问题 So I am quite new to Java and motivated to learn. This question might seem simple but I genuinely don't understand and have searched Google for answers (no luck). I am converting a decimal into Binary in Java. However, I thought representations of numbers are supposed to be given in data types int , double , and etc. The code is as follows : int decimal = 99; String binary = Integer.toBinaryString(decimal); System.out.println(binary); Why is it String binary , should it not be any of the