473,395 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to serialize number to specific format

In the code I use for serialization/deserialization is the following:

[XmlElementAttribute(Form=XmlSchemaForm.Unqualified )]
public Decimal valArcBegAngle
{
[return: MarshalAs(UnmanagedType.Currency)]
get {return m_valArcBegAngle;}
[param: MarshalAs(UnmanagedType.Currency)]
set {m_valArcBegAngle = value;}
}
private Decimal m_valArcBegAngle;

What can I do so that, if the value is zero, the output is
<valArcBegAngle>000</valArcBegAngle> instead of
<valArcBegAngle>0</valArcBegAngle>?

Thanks in advance.

Nov 30 '05 #1
1 1494
DC
use a surrogate.

example:
http://cheeso.members.winisp.net/src...e=Surrogate.cs
--
-Dino
D i n o . C h i e s a AT M i c r o s o f t . c o m
"eSapient" <eS******@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
In the code I use for serialization/deserialization is the following:

[XmlElementAttribute(Form=XmlSchemaForm.Unqualified )]
public Decimal valArcBegAngle
{
[return: MarshalAs(UnmanagedType.Currency)]
get {return m_valArcBegAngle;}
[param: MarshalAs(UnmanagedType.Currency)]
set {m_valArcBegAngle = value;}
}
private Decimal m_valArcBegAngle;

What can I do so that, if the value is zero, the output is
<valArcBegAngle>000</valArcBegAngle> instead of
<valArcBegAngle>0</valArcBegAngle>?

Thanks in advance.

Nov 30 '05 #2

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

Similar topics

8
by: John Smith | last post by:
Hi, I am using a custom Session Handler. session_set_save_handler is working well. But i want to read the data direct from the database. My problem: php don't uses the standard serialize...
2
by: Jim Cobban | last post by:
I must be missing something. I am using org.apache.xml.serialize.XMLSerializer to save a DOM but I am not getting non-basic characters converted to UTF-8. I create Text nodes in the DOM by,...
3
by: Jim Cobban | last post by:
I must be missing something. I am using org.apache.xml.serialize.XMLSerializer to save a DOM but I am not getting non-basic characters converted to UTF-8. I create Text nodes in the DOM by,...
7
by: astro | last post by:
Anyone have suggestions on where to troubleshoot this error? Background: -Access 2k v. 9.0.6926 sp3 - front and backend on production server (wiindows 2k) -accessed via Citrix -front-end is...
5
by: David Sworder | last post by:
Hi, I've created a UserControl-derived class called MyUserControl that is able to persist and subsequently reload its state. It exposes two methods as follows: public void Serialize(Stream...
1
by: Jinlin | last post by:
Does anyone know how to serialize a dataObject. Is it possible? What I try to do in my application is to allow user drag and drop objects onto a toolbox type of thing, and try to preserve these...
8
by: cd~ | last post by:
I can provide a test app, the news server won't allow me to post the files because they are too large (93KB and 1.2KB) I downloaded the ESRI ArcXml schema and generated the classes from the...
4
by: Hone | last post by:
I'm trying to serialize/deserialize the XML for an RSS 1.0 Feed (i.e. RDF) and the root element, as required by the standard, looks like this: <rdf:RDF ...> </rdf:RDF> However, I've tried...
2
by: Jen | last post by:
I have a Hashtable serializing to a binary file ok but I really would like the file to be in XML format or other readable format. I DO NOT want to change all my code, I want to keep the Hashtable...
2
by: Daniel Klein | last post by:
It looks like I'm going to have to write programs in another language to encode and decode php serialized data. I am really only interested in the permutations of how it encodes multi-dimensioned...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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,...
0
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...
0
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...

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.