Aligning numbers at decimal point angular ui grid

Rajdeep Dosanjh

I am looking at aligning numbers on the decimal point in Angular UI Grid like below.

    11.293
      .89
233424
      .34345

I have had a few ideas including a cell template with three aligned divs and using transparent 0s.

Has anyone had any luck with this.

Vandervals

I think that the best way is to select all the numbers with Javascript, then break them and encapsulate them in 2 span elements like this:

<div>
    <span class="int">11.</span><span class="float">293</span>
</div>
<div>
    <span class="int">233424.</span><span class="float">89</span>
</div>

Then you can assign a with to the elements and align the .int to right and .float to the left with css:

.int, .float{
    display: inline-block;
    width: 100px;
}
.int{
    text-align: right;
}
.float{
    text-align: left;
}

This way the selection is ok and div and span doesn't disturb the meaning of your html5 code. Also, you do not deppend on a fixed width font.

Hope this works, if not, please let me know.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Aligning a point cloud on a grid

From Dev

Make decimal point to whole numbers

From Dev

Make decimal point to whole numbers

From Dev

Kendo UI grid undefined decimal

From Dev

Convert floating point numbers to decimal numbers

From Dev

Selecting floating point numbers in decimal form

From Dev

Conversion of decimal floating point numbers to binary and back

From Dev

In a unix timestamp should there be numbers after a decimal point?

From Dev

how to subtract numbers with decimal point in php

From Dev

Formatting Numbers So They Align On Decimal Point

From Dev

storing the numbers after the decimal point into a variable in MySQL

From Dev

Getting output of 2 numbers after the decimal point

From Dev

Conversion of decimal floating point numbers to binary and back

From Dev

Searching for numbers with a comma as a decimal point in an array

From Dev

getSelectedRows in Angular UI grid

From Dev

Ruby big decimal with 2 numbers after the decimal point

From Dev

Pasting decimal numbers in excel / comma and point decimal separator

From Dev

Twitter bootstrap grid not aligning

From Dev

bootstrap grid not aligning correctly

From Dev

Angular UI Grid click row

From Dev

Kendo UI grid dropdown and angular

From Dev

Angular Formly ui grid with gridOptions

From Dev

cellClass is not working for angular ui grid

From Dev

Angular UI Grid callbacks not received

From Dev

Angular UI Grid Demo bug

From Dev

angular.js - decimal numbers in European notation

From Dev

angular.js - decimal numbers in European notation

From Dev

Trouble with aligning numbers

From Dev

Angular UI-Select in UI-Grid?