How to display digits as 99.1234564567891111 and not more than 13 decimal places in ag grid? - decimal

I want to restrict the input field in ag grid column and restrict to 13 decimal places as mentioned in the title.

though not related to AG-grid this regex /(^\d{0,2})+(?:\.\d{1,13})?$/ should give you what you are looking for.
console.log(/(^\d{0,2})+(?:\.\d{1,13})?$/.test("11.111111111111"));
console.log(/(^\d{0,2})+(?:\.\d{1,13})?$/.test("99.99999999999999"));
console.log(/(^\d{0,2})+(?:\.\d{1,13})?$/.test("11."));

Related

Conditional border creation for excel based on length of text

Okay so I've spent some time digging through stack overflow other various websites, I'm not even sure this is possible but here's the example.
I have an excel sheet with quite a bit of information, in column A there are various types of information however I specifically only want the cells that have #####-###.
The issue is that the other users will sometimes replace the last 3 digits with question marks and similarly, when adding the dash it doesn't treat it as a number it's considered general format...
Like I said I maybe have the number 60613-555, then right below it part numbers/names etc, so I only want that cell with the project number to have the top line border...
Use this as the rule:
=ISNUMBER(SEARCH("????-???",$A1))
And apply it to the columns desired:

Require a custom format for multiple layout of phone numbers

I have a list of phone numbers with various layouts (Australia) and I need to create consistency for them. I need the layouts to look like the examples below. The data is then being imported back into a database but they are not split into different cells for each number formula.
For example i have - 5382 1111, 03 5382 1111, 0417 111 111, 1300 123 123, 13 13 13,
I have tried a few different formulas through the custom format cells but they are not working correctly and numbers are being deleted from their cells.
You can use custom number formats to achieve this.
For numbers beginning with 0, also watch for preceding the data with an apostrophe (') or making the whole column text format.
If you show what you tried, we can help troubleshoot.
An approach
Hint: to incorporate landline and mobile in the same rule, try conditional custom number formats. For more details see Custom number formats and how to use them.
An example
You could try using this custom number format string:
[<100000000]#### ####;[<400000000]0# #### ####;0### ### ###
Notes on this example:
It works just fine with local landline and mobile numbers where you are.
It will even work with customers from out of the area, including interstate customers.
International numbers would be troublesome though and would need a different approach.
If you use it with any numbers that begin with a + sign and the country code, it won't work and would need a different approach.
Assumptions about your data
The above example assumes:
None of your inputs are text, they are all numbers
The leading zeroes can be either included or omitted and it should still work
All of your shortened local numbers are 8 digits (starting with any numeral, for example 5)
All of your full local or interstate numbers are 10 digits (starting with 0)
All of your mobile numbers are 10 digits (starting with 04)
Limitations
The above solution example does not deal with 1300 or 13 numbers properly:
13 numbers come out like 13 1313 instead of 131 313 or 13 13 13. Is this acceptable or do you need them like 13 13 13? If you do, what about ones that are quoted like 131 313? (automatically doing like 13 13 13 or 131 313 based on digit groupings would be a whole other complication).
1300 numbers come out like 01300 000 000. This is not ideal, but the only issue is the extra unnecessary leading 0; the rest of the format looks right.
What about 1800 numbers, do you need them too?
If you have numbers stored as text, or numbers beginning with a + and an IDD (international country) code, you will need a different approach.
If you have numbers stored in the old format from back when they were 6 digits starting with 8 (e.g. 821 111) with area code 053 (before it inherited the 03 code and moved the 53 into the start of the number), then:
You will need a different solution
Your data is more than 3 times the age of this site

Excel Custom Number Format on chart Axis

I'm trying to set a Custom format for the Y-Axis of an Excel Chart and I'm not getting the result I need. I've referenced the Peltier webpage as a good source of information on creating custom Excel formats. I've come up with the following.
[>=1000000]0,,"M";[>=1000]0,"K";0
It works well until I need the rage to show values like 1 million, 1.2 million, 1.4 million, ect... I've tried
[>=1000000]0.#,,"M";[>=1000]0,"K";0
It does display 1.2M and 1.4M as needed but it has a period on the 1 million line "1. M". How do I modify my format to only show the period when the number to right of the decimal point is not zero?
So it looks like the best approach to allow the Axis to scale normally is to show a Zero on the right hand side of the decimal point, therefore always showing decimal point.
So, using
[>=1000000]0.0,,"M";[>=1000]0,"K";0
produces
800K, 1.0M, 1.2M, 1.4M, 1.6M, 1.8M, 2M, 2.2M
Without sample data together with expected results this may require some tweaking but you can add a specific circumstance to remove the decimal point. One of these might be appropriate.
[>1000000]0.0,,\M;[=1000000]0,,\M;0.0,K
[>1000999]0.0,,\M;[>999000]0,,\M;0.0,K

Weights and Measures + 3 Significant Digits

I am looking to create a spreadsheet that will function as a tool similar a conversion website.
I am trying to convert units of measure (inches, feet, yards, millimeters and meters). When I input 36 inches, I need it to display the following:
36 inches
3 feet
1 yard
914 mm (technically this would be 914.4)
.914 m (technically this would be 0.9144).
I am trying to create a formula that will not on convert the numbers, but also break it down to show 3 significant digits (without rounding).
For converting inches to feet I've come up with this formula:
=ROUNDDOWN((CONVERT(A7,"in","ft"))/10^(INT(LOG10(CONVERT(A7,"in","ft")))+1),3)*10^(INT(LOG10(CONVERT(A7,"in","ft")))+1)
This works until I hit larger numbers for example 40 inches will display as 1010 mm and I need it to display as 1016 mm.
I have the conversion piece down, so I guess what I'm asking is how do I get it to display 3 significant digits unless the numbers is over 100, in that case everything to the right of the decimal can be dropped.
I would suggest working with full precision in the calculations and using custom number formatting to adjust the decimal places displayed while retaining the underlying value's precision for further calculation.
     
Select the cell and tap Ctrl+1 then choose Custom from the list down the left and supply a formatting mask for the Type:.
The formula in B8 is =CONVERT($B$2,$C$2,"m")*POWER(10,3) (nod to #XOR LX) and the custom number formatting Type: is [>=100]0 \m\m;0.000 \m\m.
The formula in B9 is =CONVERT($B$2,$C$2,"m") and the custom number formatting Type: is [>=100]0 \m;0.000 \m.
The value in C2 comes from a Data ► Data Validation List ► Allow: List ► Source: =$E$2:$E$9.
I've done B8 & B9. The rest should be pretty straightforward. Post back a comment if you need help with the formatting masks or other issues. see Create a Custom Number Format for more information.
This may get you going:
=IF(CONVERT(A2,"in","mm")>=100,
ROUND(CONVERT(A2,"in","mm"),0),
ROUND(CONVERT(A2,"in","mm"),2-INT(LOG10(CONVERT(A2,"in","mm"))))
)
This can be collapsed to:
=ROUND(CONVERT(A2,"in","mm"),
(CONVERT(A2,"in","mm")<100)*(2-INT(LOG10(CONVERT(A2,"in","mm"))))
)
Output
The number 2 gives you 3 significant figures. Change to 3 for 4 significant figures, etc.

In excel how to set a cost of 29.00 to a 11 digit no decimal point format

How do I tell excel I want the first two digits to be assummed to be decimal places using NNNNNNNNNNN format? thx
I'm trying to use excel format to convert 29.00 to following:
00000002900
but it keeps look like the following:
00000000029 // how do I get the 29 to move up by two digits like the first one????
I'm using custom format in excel of "00000000000" but that is not working. thx
First off, your custom format should be "00000000000" instead of "NNNNNNNNNNN" if I'm not mistaken.
If you don't want to see a decimal place you can store all your values in cents instead of dollars (multiply by 100) and use "00000000000". If you want to still use dollars and don't mind a decimal point use "000000000.00"
I don't think you can do that with a Format mask as the only way would be to actually modify the underlying value.
you could use; =TEXT(A1*100,"00000000000")

Resources