# \[AMPL 24837\] How to write percentage in Ampl code

**URL:** <https://discuss.ampl.com/t/ampl-24837-how-to-write-percentage-in-ampl-code/774>\
**Category:** Google Group Mirror\
**Created:** [October 23, 2023, 7:59am UTC](https://discuss.ampl.com/t/ampl-24837-how-to-write-percentage-in-ampl-code/774 "2023-10-23T07:59:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vivi](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/vivi/32/156_2.png) [@Vivi](https://discuss.ampl.com/u/Vivi)\
**Post date:** [October 23, 2023, 7:59am UTC](https://discuss.ampl.com/t/ampl-24837-how-to-write-percentage-in-ampl-code/774/1 "2023-10-23T07:59:25Z")

</div>

Hi AMPL Team,

For writing 25 percent in my data, I wrote 25% and I have had an error message.  
I am writing to know how to write percentage in AMPL code.

Best regards.

---

<div class="post-metadata">

**Author:** ![AMPL\_Google\_Group](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@AMPL\_Google\_Group](https://discuss.ampl.com/u/AMPL_Google_Group)\
**Post date:** [October 23, 2023, 6:11pm UTC](https://discuss.ampl.com/t/ampl-24837-how-to-write-percentage-in-ampl-code/774/2 "2023-10-23T18:11:20Z")

</div>

In your data, write .25 instead of 25%.

Another possibility is to write 25 instead of 25%, and then divide your data by 100 in the model.

---

<div class="post-metadata">

**Author:** ![Vivi](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/vivi/32/156_2.png) [@Vivi](https://discuss.ampl.com/u/Vivi)\
**Post date:** [October 23, 2023, 6:34pm UTC](https://discuss.ampl.com/t/ampl-24837-how-to-write-percentage-in-ampl-code/774/3 "2023-10-23T18:34:56Z")

</div>

Hello Mr Robert,

Many thanks for your support.

Best regards,
