473,790 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inch / Metric value

Hi NG,

in a dataset.datatab le I have rows, containing metric data as doubles.
I need to display/edit these values in textboxes depending on the culture
(Metric/Inch). Is there something like a built in conversion functionality
for that in the framework / visualstudio or do I have to do these
conversions manually?

Thanks for help and hints
Rainer
Jun 12 '06 #1
8 2333
As far as I know you would have to convert them manually.

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung

"Rainer Queck" <Ra****@noemail .noemail> wrote in message
news:eH******** *****@TK2MSFTNG P05.phx.gbl...
Hi NG,

in a dataset.datatab le I have rows, containing metric data as doubles.
I need to display/edit these values in textboxes depending on the culture
(Metric/Inch). Is there something like a built in conversion functionality
for that in the framework / visualstudio or do I have to do these
conversions manually?

Thanks for help and hints
Rainer

Jun 12 '06 #2
"Rainer Queck" <Ra****@noemail .noemail> wrote in message
news:eH******** *****@TK2MSFTNG P05.phx.gbl...
do I have to do these conversions manually?


There's nothing built-in, but it really has to be one of the simplest things
to write...
Jun 12 '06 #3
Mark Rae wrote:
"Rainer Queck" <Ra****@noemail .noemail> wrote in message
news:eH******** *****@TK2MSFTNG P05.phx.gbl...
do I have to do these conversions manually?


There's nothing built-in, but it really has to be one of the simplest things
to write...


Sure, but it's always nice to check first to make sure you're not
re-inventing the wheel.

No, there isn't, but there should be. Just as I was surprised to find
no framework support for loading currency conversion rates and doing
currency conversions. Not that MS could somehow provide the conversions
themselves, just some kind of standard way of loading and using them
would be nice.

Same with units of measure and unit conversions: it would be nice if MS
would just build them into the framework. Yes, they're dead simple and
100% internationally standard, but then how many people have written
them over and over again, all over the world? All the more reason to
toss them in the .NET Framework, IMHO.

Jun 12 '06 #4
"Bruce Wood" <br*******@cana da.com> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.com.. .
There's nothing built-in, but it really has to be one of the simplest
things
to write...


Sure, but it's always nice to check first to make sure you're not
re-inventing the wheel.


Quite so.
Jun 12 '06 #5
Hi Rainer,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you have a column containing data in
Metric data and you need to display and modify it in Metric/Inch accroding
to the user settings. If there is any misunderstandin g, please feel free to
let me know.

Generally, you need to do the conversion from Metric to Inch and backward
yourself. But if you only need to do the display, there is a simpler
solution. You can add another column with an expression to the current
DataTable. The new expression column counts from Metric to Inch with an
expression. For example:

ExpCol.Expressi on = "OrigCol/2.54";

Then bind certain textbox to the ExpCol to display the inch data. However,
the expression column is read-only and you cannot modify the value directly
in that column. If user changed the value in the textbox, count the value
for the OrigCol, and modify the OrigCol in DataTable and the ExpCol value
will change automatically.

HTH.

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== ===========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =============== =============== =
=============== ===========

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 13 '06 #6
Hi Bruce,
There's nothing built-in, but it really has to be one of the simplest
things
to write...
Sure, but it's always nice to check first to make sure you're not
re-inventing the wheel.

You caught my thought ;-)

No, there isn't, but there should be. Just as I was surprised to find
no framework support for loading currency conversion rates and doing
currency conversions. Not that MS could somehow provide the conversions
themselves, just some kind of standard way of loading and using them
would be nice.

Same with units of measure and unit conversions: it would be nice if MS
would just build them into the framework. Yes, they're dead simple and
100% internationally standard, but then how many people have written
them over and over again, all over the world? All the more reason to
toss them in the .NET Framework, IMHO.

You have my vote on that!

Rainer
Jun 13 '06 #7
Hi Kevin,

thanks for your responds.

"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> schrieb im Newsbeitrag
news:<lx******* *******@TK2MSFT NGXA01.phx.gbl> ...
Generally, you need to do the conversion from Metric to Inch and backward
yourself. It's a pity. I am quit new to the framwork, but the functionallity I
experienced up to now is really great!
Thats why I was hoping, that this kind of "commonly needed" functinallity
would be in it. Well...
But if you only need to do the display, there is a simpler
solution. You can add another column with an expression to the current
DataTable. The new expression column counts from Metric to Inch with an
expression. For example:

ExpCol.Expressi on = "OrigCol/2.54"; This is how I have done it in the meanwhile.
Then bind certain textbox to the ExpCol to display the inch data. However,
the expression column is read-only and you cannot modify the value
directly
in that column. If user changed the value in the textbox, count the value
for the OrigCol, and modify the OrigCol in DataTable and the ExpCol value
will change automatically.

Yes, I think this is how I will approach the issue.

Thanks
Rainer
Jun 13 '06 #8
You're welcome, Rainer. Good luck! If you have anything unclear, please
feel free to post it in the community.

Kevin Yu
Microsoft Online Community Support

=============== =============== =============== =============== =============== =
=============== ===========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =============== =============== =
=============== ===========

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jun 14 '06 #9

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

Similar topics

52
9678
by: piaseckiac | last post by:
I am producing a website on air and need a link to change the entire website from standard to metric for temperature, pressure, miles-kilometers, and volume. Thank you.
23
3953
by: Brian | last post by:
Despite charset being discussed to death, and despite having followed all of those threads, I still have problems. http://www.tsmchughs.com/recipes/soda-bread This page uses iso-8859-1 charset. From the headers: Content-Type: text/html; charset=iso-8859-1 Under ingredients are characters for fractions (188, 189, and 190) and the degree character (176), characters which Lynx can display on
7
3752
by: El Camino | last post by:
Howdy all Im trying to do a fairly accurate metric conversion between: inches feet yards Im pretty sure that i have the right number for conversion
4
1905
by: Jimmy | last post by:
hi, all I attempt to use the function inch() to get the character at the current position, and compare it with a particular character like : if screen.inch(x,y) == 'F' but this method doesn't seem work, can anyone tell me the reason and how to corrent it thanks
3
3895
by: socondc22 | last post by:
Im stuck at this point. The way i was trying to do this was running if statement around my void function and then a else if statement around a different void function but it didnt work... right now i deleted part of what i had but left my skeleton of it there... #include <iostream> using namespace std; void get_numbers(double& input1, double& input2); void show_results(double output1, double output2); int main() { char letter;
3
3138
by: headware | last post by:
I have to create some vertical text for a web page that allows users to print to labels. We decided to do this by creating an <imgtag on the web page and having the src attribute point to another ASP.NET page that generates the image on the fly and streams it back to the browser. It works fine, but I'm worried about sizing issues. The image has to be a specific height and width to fit properly onto the label. The constructor for the...
2
1293
by: cbmeeks | last post by:
Man, I realize I've been asking a lot of questions lately. I appreciate you guys helping me in my thought process. This time, I have a design question I want opinions on. I'm building a business framework for tracking trending data. I have a class like: class Metric
0
9512
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
10413
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
10200
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
10145
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
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4094
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
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.