Questions tagged as 'decimal'

3
answers

Insert decimal variable in firebird

I'm doing an Insert in the Firebird database in a UnitUnit (decimal) field, but the decimal places in the table do not appear. C # code: public decimal ValorUnitario { get; set; } produto.ValorUnitario = Convert.ToDecimal(5.50); string sql...
asked by 04.01.2017 / 20:56
1
answer

1264 Out of range value adjusted for column with decimal field

I have a hotel table in my database with a estrelas(decimal(1,1)) column that receives the hotel's note (from 0.0 to 5.0), but whenever I try to enter or change a field and put a higher value that 0.9 it does not record giving this alert:...
asked by 08.03.2016 / 21:15
2
answers

Decimal to binary conversion in C language

The code below, from the original ( link ) "prints" a decimal number between 0 and 255 in binary. #include <stdio.h> #include <stdlib.h> int main() { int n; // Número de entrada int r; // Resultado do deslocamento int i; // C...
asked by 28.06.2017 / 05:03
1
answer

Insert, sum and display value (in real) using PHP and MySQL [duplicate]

Hello, I am a beginner in PHP and MySQL. I would like to have a form where I enter a value (in real, in the case), add with what you have already saved in the database, and finally display to the user the result of this calculation. It's qu...
asked by 23.06.2018 / 01:47
0
answers

ASP.NET MVC: Problem assigning decimal value

ViewModel.cs Tab [Required(ErrorMessage = "A altura é obrigatória.")] public decimal Altura { get; set; } ficha.js $("#Altura").mask("9.99"); Controller.cs Tab [HttpPost] public ActionResult Cadastro(FichaViewModel fichaView) { i...
asked by 07.12.2017 / 16:00
0
answers

How to calculate + 10.5% in a product

How to calculate + 10.5% on a product? My calculation looks like this: private void txtMargemLucro_Leave(object sender, EventArgs e) { txtPrecoVenda.Text = (Convert.ToDecimal(txtPrecoCusto.Text) * Convert.ToDe...
asked by 22.08.2016 / 07:22
0
answers

Fill double zero to the left in java

I would like to know how do I format a double with two boxes to the left of the dot and two to the right of the dot. Example: I have double 1.1 I want it to be formatted for 01.10; entry: 10.1 / 1.05 Output: 10.01 / 01.05     
asked by 29.04.2016 / 21:17
1
answer

Decimal to binary conversion in the C language using the ASCII table

I have to do a program that reads some characters and "transforms" each character into its corresponding number in the ASCII table and then transforms that number into binary and stores it into a vector. My code so far is: #include <stdio.h...
asked by 28.06.2017 / 17:49