Click here to Skip to main content
12,450,981 members (23,720 online)
Rate this:
 
Please Sign up or sign in to vote.
Hi all,
i tried to convert amount in words as Indian currency but in case of amount is in lacs
or above conversion is not properly.

My formula in CR is:

1.

formula= Towords(truncate(890010.89), 0) + " and " + towords(abs(100 * (truncate(890010.89)- 890010.89)), 0) + " centavos";


2.

local stringvar sNumber := cstr(Sum (890010.89));
local numbervar whole := truncate(Sum (890010.89));
local numbervar pos := instrrev(sNumber, '.');
local numbervar decimal := 0;

if pos > 0 then
(
decimal := CDbl(right(sNumber, length(sNumber) - pos));
);

Uppercase(ToWords(whole, 0) + ' Rupee(s) and ' + ToWords(decimal, 0) + ' Paise Only');


Note: Above formulas working properly upon thousands but for thousands above not working...

Please help me for proper conversion either in terms of lacs or above..
Posted 28-Feb-12 19:27pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 29 Feb 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100