473,651 Members | 2,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

converting number to currency type

hi

I am trying to pass range parameters to crystal reports from my .net environment. The start and end values of the range parameters are of currency type. I need to convert the number to currency data type for which I am using CCur function provided by .Net, but it throws an error stating "The name 'CCur' does not exist in the class or namespace.

Any help would be appreciated. Thanks in advance

Mukes

Jul 21 '05 #1
5 7138
Mukesh Kumar <mu*****@yahoo. com> wrote:
I am trying to pass range parameters to crystal reports from my .net
environment. The start and end values of the range parameters are of
currency type. I need to convert the number to currency data type for
which I am using CCur function provided by .Net, but it throws an
error stating "The name 'CCur' does not exist in the class or
namespace.


I haven't heard of CCur before, and it doesn't appear in the MSDN index
except under scripting. Could you say where you saw that it was
provided by .NET?

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
hi Jon

Please search for CCur in MSDN and select the option Currency(crysta l syntax). It is not available in the index. If you have any other option to convert from number to currency then please help me

Thanks in advanc

Mukesh
Jul 21 '05 #3
Jon

I believe CCur is a function of visual basic for application which can be used in crystal reports. but is there any equivalent in .net Framework

Sorry and thanks

Mukesh
Jul 21 '05 #4
Mukesh Kumar <an*******@disc ussions.microso ft.com> wrote:
Please search for CCur in MSDN and select the option Currency(crysta l
syntax). It is not available in the index.
That's a function within Crystal Syntax for formulas - it's not a
method within a .NET type.
If you have any other
option to convert from number to currency then please help me.


You can use the "C" standard numeric format specifier, eg

using System;

public class Test
{
static void Main()
{
Console.WriteLi ne ("{0:C}", 1.5);
}
}
--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #5
guy
currency has gone away in .NET, use Decimal and CDe

hth guy
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1979
by: alien2_51 | last post by:
At some point after running this report the "Wholesale Price" column data type in the excel spread sheet changes from Currency to General... It seems to ba around the 300th or so row but varies... This problem only occurs if the client is running Office XP.. And only in our production environment, not test or dev they are supposed to identical to prod but I doubt that for obvious reasons... Can someone tell me why, or give some...
0
2255
by: Marcelo López | last post by:
Hello everybody. I'm working with an office pivot table and i have to convert from its currency type to a decimal (in C#) , operate with the result and then re-convert it to the currency type to add a new attributte in a xml's node I am converting it from currency to decimal using decimal.parse, but i cannot convert from the result in decimal to the current type again. Ideas ??
3
6802
by: Caesar Augustus | last post by:
Hello Tom, Long time listener, first time caller... I have been working with vb code to automate a salary increase process that not only rounds to the nearest penny but also rounds to the nearest even penny using the code that follow. The problem I have is that once I set the even rounded value back to the text field it adds a 01 on the end of the raounded value (i.e. 1234.56 is 1234.5601)
13
3140
by: jm | last post by:
I am trying to use datepart to get the real name of the month like "April" or "APR" not just "4." I could not find it in the documentation. Sorry. Thank you.
0
1329
by: Marcelo López | last post by:
Hello everybody. I'm working with an office pivot table and i have to convert from its currency type to a decimal (in C#) , operate with the result and then re-convert it to the currency type to add a new attributte in a xml's node I am converting it from currency to decimal using decimal.parse, but i cannot convert from the result in decimal to the current type again. Ideas ??
5
745
by: Mukesh Kumar | last post by:
hi I am trying to pass range parameters to crystal reports from my .net environment. The start and end values of the range parameters are of currency type. I need to convert the number to currency data type for which I am using CCur function provided by .Net, but it throws an error stating "The name 'CCur' does not exist in the class or namespace. Any help would be appreciated. Thanks in advance Mukes
11
3213
by: Penfold | last post by:
I'd appreciate help converting student average test scores into grades. My problem is that I need to allocate one of about 20 grades (3a,3b,3c,4a,4b,4c etc through to 8c plus a couple of others). This comes up as too complex using nested IIf, then, else. I tried a lookup table but here the problem I found was that unless the average test score matches exactly then no grade is returned. For example a score of 11.0 returns grade 4b but a...
1
2084
by: pebelund | last post by:
Hi I got an .aspx that got the following code (example) <td width="120"> <% = row %> </td> row takes a value from a SQL db, that is a string of numbers. On the webbsite I want this to show as value formatted in thousands (example: I get the value 12345678, and I want it to show like 12 345
116
35826
by: Dilip | last post by:
Recently in our code, I ran into a situation where were stuffing a float inside a double. The precision was extended automatically because of that. To make a long story short, this caused problems elsewhere in another part of the system where that figure was used for some calculation and some eventual truncation led to the system going haywire. So my question is, given this code: int main() { float f = 59.89F;
0
8349
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8795
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8460
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.