Question: i have this code in my updatetobill code. im planning to round it off to nearest tenth i think? for example the price is 123456.123456, what i want to do is to have it as 123456.12 because since its a price, i need the cents. thanks in advance for any help :)

```
private void UpdateTotalBill()
    {
        double vat = 0;
        double TotalPrice = 0;
        long TotalProducts = 0;
        foreach (DataListItem item in dlCartProducts.Items)
        {
            Label PriceLabel = item.FindControl("lblPrice") as Label; // get price 
            TextBox ProductQuantity = item.FindControl("txtProductQuantity") as TextBox; // get quantity
            double ProductPrice = Convert.ToInt64(PriceLabel.Text) * Convert.ToInt64(ProductQuantity.Text); //computation fro product price. price * quantity
            vat = (TotalPrice + ProductPrice) * 0.12; // computation for total price. total price + product price
            TotalPrice = TotalPrice + ProductPrice+40 +vat;
            TotalProducts = TotalProducts + Convert.ToInt32(ProductQuantity.Text);

        }
        Label1.Text = Convert.ToString(vat);
        txtTotalPrice.Text = Convert.ToString(TotalPrice); // put both total price and product values and converting them to string
        txtTotalProducts.Text = Convert.ToString(TotalProducts);
    }

```

Answer: 
An svg text node cannot be the child of a foreignObject node, you need an svg node in the way. E.g.

```js
        var s = document.getElementById('t');
        var g = s.childNodes[1];
        console.log(g.childNodes[1].remove());
        var foreign = document.createElementNS('http://www.w3.org/2000/svg',"foreignObject");

        foreign.setAttribute('width', 500);
        foreign.setAttribute('height', 150);
        var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
        var txt = document.createElementNS('http://www.w3.org/2000/svg', 'text');
        txt.setAttribute('x', '10');
        txt.setAttribute('y', '30');
        var t = document.createTextNode("This is a paragraph.");
        txt.appendChild(t);
        foreign.appendChild(svg);
        svg.appendChild(txt);
        g.appendChild(foreign);
```

```html
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>
    <svg id="t">
    <g>
        <text x="10" y="30">hello</text>
    </g>
    </svg>
</body>
</html>
```

Having said that, I don't see why you'd want to use foreignObject unless you're going to create some non-svg nodes.

The other thing that trips people up is creating elements in the correct namespace. SVG elements need to go in the SVG namespace(<http://www.w3.org/2000/svg>).

Perhaps rerunning it forces Chrome to create the svg parent node itself or perhaps it's just a Chrome bug.
Actually your appending child part is creating the probelm.

you didn't appended it in proper order.

Check the code below and give a try

```
        var s = document.getElementById('t');
        var g = s.childNodes[1];
        g.childNodes[1].remove();
        var foreign = document.createElementNS('http://www.w3.org/2000/svg',"foreignObject");
        foreign.setAttribute('width', 500);
        foreign.setAttribute('height', 150);
        var t = document.createTextNode("This is a paragraph.");
        foreign.appendChild(t);
        g.appendChild(foreign);

```

let me know if it is working