Tuesday, May 31, 2011

Round /Turncate numeric values in xslt

To round a numeric value to some specific decimal places in xslt , we need to code like this.

<xsl:value-of select="format-number(price,'#.####')"/>

if price value is 11.5246956 then it would round to 4 decimal places and result would be 11.5247

if price value is 11.25 then it would round to 4 decimal places and result would be 11.25 not 11.2500

what if we want to round to 4 decimal places and also want to show 11.25 to 11.2500 then need to use the following code.

<xsl:value-of select="format-number(price,'#.0000')"/>

it would round to 4 decimal places and every value that has less then 4 decimal palces will be shown by appending 0 to left. e.g if price value is 11.25 it will show to 11.2500

and some cases we don't need to round value to specific values we just need to truncate it by 4 decimal places , for exapmle  if price value is 11.5246956 and want to show it 11.5246 just up to 4 decimal places but no round then following code can be used.

<xsl:value-of select="format-number(concat(substring-before(price,'.'),'.', substring(substring-after(price,'.'),1,5)),'#.00000')"/>

How to change a column name in sql server using t-sql.

here is the way to change a column name in t sql
EXEC sp_rename @objname = 'tablename.oldcolumnName', @newname = 'newcolumnName',@objtype = 'COLUMN'

reference : http://msdn2.microsoft.com/en-us/library/ms188351.aspx

Saturday, May 28, 2011

Yahoo messenger was not showing conversation messages

i had a problem last month in yahoo messenger and it was not showing messages in conversation .

i tried to figure out and then came to know that some dll was not registered correctly , here is the way to fix this issue.

  • Run command prompt as Administrator

  • set folder locaiont using following command :
    32-bit: cd C:\windows\System32
    64-bit: cd C:\windows\SysWow64

  • Type the following command and hit Enter:
    regsvr32 jscript.dll

  • Type the following command and hit Enter:
    regsvr32 vbscript.dll


    If yo don’t run the command prompt as windows administrator then you will get following error.
    The module "jscript.dll" was loaded but the call to DllRegisterServer failed with error code 0x80004005.

    For more information about this problem, search online using the error code as a search term.

    Same can be applied if you found following error when installing adobe cs 3
    Internal Error 2739 when installing Adobe CS3 Products






Run command prompt as Administrator