Unable to write dicom file with double values

Thank you for the information.
Now i am trying to add header tag data for rescale intercept . The writer is throwing exception.

Unhandled Exception: System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   at itk.ImageFileWriter<itk::Image<short,2> >.GenerateData(ImageFileWriter<itk::Image<short\,2> >* ) in C:\ITK_4.13_x86_vs17\ITK\include\ITK-4.13\itkImageFileWriter.hxx:line 429
   at itk.ImageFileWriter<itk::Image<short,2> >.Write(ImageFileWriter<itk::Image<short\,2> >* ) in C:\ITK_4.13_x86_vs17\ITK\include\ITK-4.13\itkImageFileWriter.hxx:line 363
   at itk.ImageFileWriter<itk::Image<short,2> >.Update(ImageFileWriter<itk::Image<short\,2> >* ) in C:\ITK_4.13_x86_vs17\ITK\include\ITK-4.13\itkImageFileWriter.h:line 165

This is the code

using DictionaryType = itk::MetaDataDictionary; 
	DictionaryType& dictionary = inputImage->GetMetaDataDictionary();

 std::string rescaleIntercept("0028|1052");
		std::string rescaleInterceptValue("0");
		itk::EncapsulateMetaData<std::string>(dictionary, rescaleIntercept, rescaleInterceptValue);

		std::string rescaleSlope("0028|1053");
		std::string rescaleSlopeValue("1000");
		itk::EncapsulateMetaData<std::string>(dictionary, rescaleSlope, rescaleSlopeValue);

I am not able to update only these two tags. Along with it i changed 2 more tags (“0008|0016” and 0018|6032) .Those are getting updated. But not rescale tags.
Any help is appreciated.

Thanks & Regards
Hasna