Most voted "number-format" questions
42 questions
Sort by count of
-
8
votes6
answers28831
viewsHow to limit an input of type Number to only 3 characters?
I have a problem with a variable of the type integer, for the maxlength="" only works with string and I need to stop, but it’s like Number. I think you need javascript, if anyone knows the solution…
-
5
votes1
answer3181
viewsDecimal places c#
I have a variable of decimal type returning me the value 270.61864847349717630804948048 how do I return with only 3 houses after the comma, in case pass 270.618 only. Thanks in advance…
-
4
votes3
answers2308
viewsFormat double output with dot instead of comma
I have a collection of coordinates to popular the Peater, with city name, latitude and longitude. .aspx <form id="form1" runat="server"> <div id="repetidor"> var markers = […
-
3
votes1
answer404
viewsError in monetary mask, saved with the right digits but at display time 2 digits are missing
Colleagues! When I save the product gets the correct digits as on the screen above. However, when I enter the list of products and click on the product Scissors it opens on the registration screen…
-
3
votes1
answer127
viewsFormat Combobox value pulled from SQL database (LINQ) in C# Project (WPF)
I need some help with the code below... I need to make the Float value pulled from the SQL Database in the Brazilian format of the Real Number Set in a C# (WPF) project in a Combobox (as Double).…
-
3
votes1
answer732
viewsHow to convert million units into dozens unit in R?
Suppose I have the number 80 million. Numero = 80000000 print(Numero) [1] 8e+07 Because it is a large number the R already shows me in Scientific Number, but I would like to convert that number that…
-
2
votes2
answers1639
viewsSplit values in Brazilian currency (R$) in php?
I need to divide the value 6999,99 by 3, but when dividing it returns 2333,00 ie does not return the cents, follows a hypothetical example: $parcelas = 3; $valor = double(6.999,99); //já usei com e…
-
2
votes2
answers1166
viewsSwap a dot for a comma and add a dot
How do I add the comma to the decimal place and the dot to the thousands. Example: $pagamento = R$ 1000.50; /* trecho a fazer a operação */ echo $pagamento; //saída: "R$ 1.000,50"…
-
2
votes1
answer379
viewsFormat numbers correctly in Java
I’m trying to use the NumberFormat to format some values in Java but it always returns the rounded value. I’ve done enough research to see if I can make it not happen, but I haven’t found anything…
-
2
votes4
answers931
viewsPython columns excel csv
I made this number generator that gets saved in a csv file that I open in excel, the combinations are generated in column A but n want it to appear in A. as I do for her to appear in column B and C?…
-
2
votes2
answers3800
viewsFormat number with Javascript
I need to format whole numbers, example: let num = 1234567; // saída 1.234.567 However, if the number you are going to have has decimal places that appear to no more than two decimal places.…
-
2
votes1
answer73
viewsHow to use the React useRef hook with the Numberformat component?
I am using the lib react-number-format to take a value as formatted currency in my form and then save it to a state. Currently it is this way: <NumberFormat thousandSeparator={true}…
javascript react react-hooks number-format react-domasked 3 years, 8 months ago Danúbio Vieira Lima 397 -
1
votes2
answers433
viewsIncompatibility between maskmoney and number_format
I have a form field in which I am using the maskmoney, but when the number entered enters the thousand, the number_format returns only the first four decimal places. The call of maskmoney:…
-
1
votes0
answers36
viewsHow to display the value of 8.0E-5 with php
Whoa, somebody knows how to convert this 8.0E-5 value for its original value?
-
1
votes0
answers70
viewsMask Credit Card with JSF
I would like to mask on the screen the user’s credit card number for this format #######*****####. But when using this Pattern it pushes the numbers to the right and does not replace them. Does…
-
1
votes1
answer9962
viewsFormat Number in Flutter
I have the following function that calculates and saves 2 data in my database, but I want to format kwhAparelho and totalAparelho in a way that does not cause periodic tithes and preferably this way…
-
1
votes1
answer188
viewsHow to convert a string to a direct number from the prompt?
I’m starting to learn JavaScript and I care about writing a code redundant/repetitive, has some more appropriate way of converting strings from prompt in numbers before inserting into array?…
-
1
votes2
answers71
viewsAndroid Edittext type number make appear keyboard with numbers and comma
I am working with values in editText and I need the input to be only numbers and comma to floating point. I tried with inputType="numberDecimal" but when opening the keyboard only allows the point…
-
1
votes1
answer87
viewsHow can I decrease the level of complexity of this function?
I’m learning development Web with HTML, CSS and Javascript and I came across the problem of generating a phone number with parentheses, dash and space. As I’m starting I developed a code that…
javascript function code-review number-formatasked 4 years, 2 months ago Rogério Rodrigues Sousa 19 -
0
votes0
answers83
viewsJavascript - Filling Textbox with numbers, strings and dates in a boleto
I am trying to get a ticket filled automatically when selecting a row from a table. In this case, there are textbox (or text inputs) that must be filled with some values. My function is function…
-
0
votes0
answers970
viewsFill double zero left in java
I would like to know how to format a doouble 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 formatted to 01.10; input: 10.1 / 1.05 output…
-
0
votes0
answers174
viewsFormat an input number
I have a system that calculates the average of the fields and then executes the javascript below, only the result comes out like this 0.222048 and the correct would be 222.048, how to do this…
-
0
votes1
answer420
viewsRounding numbers on Android
I am wanting to format numbering to only two decimal places after the comma, I am using the following code line NumberFormat formato = new DecimalFormat("0.00"); But my application’s minimum API is…
-
0
votes1
answer76
viewsHow do I format the actual values of my Android application?
I want editText values to appear in real.. how do I format within my current code conditions? import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface;…
-
0
votes1
answer1504
viewsC# excel format column
I am trying to format an excel column for currency format. excelWorksheet.Range["S1", "S" + linhas].NumberFormat = "R$ #.###,00" But this causes it to format this way "RR$ 3500,00". In the cell is…
-
0
votes0
answers161
viewsInclude a point and comma to a variable
Hello, I have a small problem, I have a number coming from a sum and I need to assign a mask to that number. I did some tests until it worked however the mask was not correct to the number. var…
-
0
votes2
answers493
viewsError Converting String to Numbers in Java
In my last post (do/while repeats the expression twice) was having an input overlay problem using the Scanner class, and according to the links placed in the answer, we cannot use nextLine() after…
-
0
votes0
answers200
viewsNumber Format PHP
I need to format the number 1000 THOUSAND for 100,0 or 100.0 that is, with a decimal place in PHP. I tried to number_format but returns 1000.00 or 1,000.00.…
-
0
votes0
answers52
viewsAdd a zero when there is only 1 decimal
Good staff, I have a system for issuing electronic invoice, there is a government rule where the values of duplicates(installments) must possess exact 2 decimal places. I use number_format to…
-
0
votes1
answer122
viewshow to add semicolon in animated number that activates with the scroll movement in javascript
I am a laywoman in javascript. My boss dreams of putting such a "stopwatch" on the site (animated numbers that trigger a movement similar to a machine counting the numbers, which activate when you…
-
0
votes0
answers102
viewsNan non-numeric number return in PHP
I’m having problems in displaying the data of a budget already imputed in the database. When accessing the detail is displaying the R$ NaN in the currency fields. Code of some functions:…
-
0
votes0
answers13
viewsFormat no Octave
Hi, I’m applying the textscan function to the Octave and I want it to read 3e-6 and 100, and turn to 3.0000e-06 and 1.0000e+03, as I should write this textscan??
-
0
votes2
answers48
viewsString sub-stituir per variable
i have the following text inside a.txt file [ExpertSingle] { 1050 = N X 0 1260 = N X 0 1470 = N X 0 1680 = N X 0 1890 = N X 0 2100 = N X 0 I want to turn "X" into numbers using Choice Ring to look…
-
0
votes1
answer92
viewsHow to replace by following a pre-determined python pattern
within txt have 12480 = B X 43200 = B X 47040 = B X 50880 = B X 54720 = B X 58560 = B X 62400 = B X 66240 = B X 70080 = B X 73920 = B X 77760 = B X 85440 = B X 89280 = B X 93130 = B X 96960 = B X I…
-
0
votes2
answers81
viewsForce user to mark at least 5 input type number fields
I’m making a website with counter with a button more and less... All are input number type with limit of 0 to 5 each input. There are 33 input type numbers, of which 33 the user will have to choose…
-
0
votes2
answers53
viewsHow to transform a numeric value into CURRENCY FORMAT (Brazilian Real) in SELECT MYSQL
Hello, Success and peace to all! CREATE TABLE IF NOT EXISTS `lancamentos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data` date DEFAULT NULL, `mes_referencia` varchar(50) DEFAULT NULL, `cliente`…
-
-1
votes1
answer228
viewsFormat number from 3200 to 3,200 with PHP
I have to transform values like: 3200 5000 10000 13000 100000 in 3.200 5.000 10.000 13.00 100.000 I tried to use the function number_formatof PHPbut I could not do it correctly. How can I solve this…
-
-1
votes1
answer2338
viewsFormat numerical latitude and longitude in Javascript
I need to put the number of decimals in my latitude and longitude; currently they meet like this: -50850080, -29361808 And I’d like it to stay that way: -50.850080, -29.361808 Only it had to be…
-
-1
votes1
answer39
viewsParameter error
function tr_rating_format_number($id = NULL, $display = NULL) { $return = number_format(get_post_meta($id, 'ratings_average', true), 1); $return = get_post_meta($id, 'ratings_average', true) == '' ?…
-
-1
votes1
answer73
viewsTax Calculator - Cents Aren’t Adding Up
Good night, you guys. I’m trying to make a simple tax calculator, it’s working except for the question of the pennies that don’t show up at full value. ** index php. ** <?php require…
-
-2
votes1
answer113
viewsHow to convert money mask to php
I have the following value in real "513.40" wish that this value stay in full example 513.40000 with all rounding, how can I do this ?
-
-5
votes1
answer114
viewsTurn 2600 into 26.00 in PHP?
I will have values like 2600 or 15000 and need to put as 26.00, 150.00, etc. How can I do this in PHP ? With the function number_format it puts wrong (in my case) as 2600,00 or 15,000,00. How can I…