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')"/>
Tuesday, May 31, 2011
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
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.
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
Saturday, April 16, 2011
Change Admin Password in drupal 7
last week i installed drupal 7 but i forgot the admin password and i was looking to change this in database as there was no email configuration on my local pc . after some R&D i come to know this method
put the following code in drupal root directory and then change the $pwd value to your desired password and the visit this file in browser and you will a hash password and update it direclty in databse
as
in my case uid was 1 .
put the following code in drupal root directory and then change the $pwd value to your desired password and the visit this file in browser and you will a hash password and update it direclty in databse
as
UPDATE users SET pass = '[hash]' WHERE uid = 1;in my case uid was 1 .
<?php
$pwd = 'password';
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
header("Content-Type: text/plain; charset=utf-8");
echo user_hash_password($pwd);
?>source : http://drupal.org/node/865818
Change appache port in wamp
Open the httpd.conf file in apace folder where wamp is installed (C:\wamp\bin\apache\Apache2.2.17\conf) , then search for listen 80 and then replace 80 to anyother port that you want.
or you can direct open the httpd.conf file by clicking the wamp icon in task bar as:
or you can direct open the httpd.conf file by clicking the wamp icon in task bar as:
Friday, April 15, 2011
How to Edit files in Inetpub folder in Windows 7
Run the following command from an elevated command prompt (right click the "command prompt" icon and select "Run as Administrator").
icacls %systemdrive%\inetpub /grant %userdomain%\%username%:(OI)(CI)(F) /grant %userdomain%\%username%:F
This command will add full access for your user account to the INETPUB directory. Now the Administrator privileges which you don't have don't matter anymore because your account and not Administrators grant you access
source : http://forums.iis.net/t/1147354.aspx
icacls %systemdrive%\inetpub /grant %userdomain%\%username%:(OI)(CI)(F) /grant %userdomain%\%username%:F
This command will add full access for your user account to the INETPUB directory. Now the Administrator privileges which you don't have don't matter anymore because your account and not Administrators grant you access
source : http://forums.iis.net/t/1147354.aspx
Configure IIS7 for SQL Server data in App_Data path
- Start IIS
- Open Application Pools by clicking on it
- Right click on DefaultAppPool and select “Select Application Pool Defaults”
- Change “Identity” property to “NetworkService”
- Save and exit IIS
Source : http://forums.iis.net/t/1162069.aspx
Subscribe to:
Posts (Atom)